mythix-orm-postgresql 1.0.5 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -185,7 +185,7 @@ class PostgreSQLConnection extends SQLConnectionBase {
|
|
|
185
185
|
inheritedThis.inTransaction = client;
|
|
186
186
|
|
|
187
187
|
try {
|
|
188
|
-
await inheritedThis.query(`BEGIN${(options.mode) ? ` ${options.mode}` : ''}`);
|
|
188
|
+
await inheritedThis.query(`BEGIN${(options.mode) ? ` ${options.mode}` : ' DEFERRABLE'}`);
|
|
189
189
|
} catch (error) {
|
|
190
190
|
if (!options.connection)
|
|
191
191
|
await client.release();
|
|
@@ -34,11 +34,6 @@ class PostgreSQLQueryGenerator extends SQLQueryGeneratorBase {
|
|
|
34
34
|
')',
|
|
35
35
|
];
|
|
36
36
|
|
|
37
|
-
if (options.deferred === true) {
|
|
38
|
-
sqlParts.push(' ');
|
|
39
|
-
sqlParts.push('DEFERRABLE INITIALLY DEFERRED');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
37
|
if (options.onDelete) {
|
|
43
38
|
sqlParts.push(' ');
|
|
44
39
|
sqlParts.push(`ON DELETE ${options.onDelete.toUpperCase()}`);
|
|
@@ -49,6 +44,15 @@ class PostgreSQLQueryGenerator extends SQLQueryGeneratorBase {
|
|
|
49
44
|
sqlParts.push(`ON UPDATE ${options.onUpdate.toUpperCase()}`);
|
|
50
45
|
}
|
|
51
46
|
|
|
47
|
+
if (options.deferred !== false) {
|
|
48
|
+
sqlParts.push(' ');
|
|
49
|
+
|
|
50
|
+
if (Nife.instanceOf(options.deferred, 'string'))
|
|
51
|
+
sqlParts.push(options.deferred);
|
|
52
|
+
else
|
|
53
|
+
sqlParts.push('DEFERRABLE INITIALLY DEFERRED');
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
return sqlParts.join('');
|
|
53
57
|
}
|
|
54
58
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mythix-orm-postgresql",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "PostgreSQL driver for Mythix ORM",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/th317erd/mythix-orm-postgresql#readme",
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"mythix-orm": "^1.
|
|
37
|
-
"mythix-orm-sql-base": "^1.
|
|
36
|
+
"mythix-orm": "^1.3.0",
|
|
37
|
+
"mythix-orm-sql-base": "^1.1.1"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"nife": "^1.11.3",
|