@travetto/model-sql 3.1.14 → 3.2.0-rc.0
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.
- package/package.json +7 -7
- package/src/dialect/base.ts +15 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-sql",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0-rc.0",
|
|
4
4
|
"description": "SQL backing for the travetto model module, with real-time modeling support for SQL schemas.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sql",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"directory": "module/model-sql"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@travetto/config": "^3.
|
|
31
|
-
"@travetto/context": "^3.
|
|
32
|
-
"@travetto/model": "^3.
|
|
33
|
-
"@travetto/model-query": "^3.
|
|
30
|
+
"@travetto/config": "^3.2.0-rc.0",
|
|
31
|
+
"@travetto/context": "^3.2.0-rc.0",
|
|
32
|
+
"@travetto/model": "^3.2.0-rc.0",
|
|
33
|
+
"@travetto/model-query": "^3.2.0-rc.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@travetto/command": "^3.
|
|
37
|
-
"@travetto/test": "^3.
|
|
36
|
+
"@travetto/command": "^3.2.0-rc.0",
|
|
37
|
+
"@travetto/test": "^3.2.0-rc.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
40
40
|
"@travetto/command": {
|
package/src/dialect/base.ts
CHANGED
|
@@ -478,20 +478,23 @@ export abstract class SQLDialect implements DialectState {
|
|
|
478
478
|
}
|
|
479
479
|
break;
|
|
480
480
|
}
|
|
481
|
-
case '$
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
481
|
+
case '$exists': {
|
|
482
|
+
if (field.array) {
|
|
483
|
+
const valueTable = this.parentTable(sStack);
|
|
484
|
+
const alias = `_all_${sStack.length}`;
|
|
485
|
+
const pPath = this.ident(this.parentPathField.name);
|
|
486
|
+
const rpPath = this.resolveName([...sStack, field, this.parentPathField]);
|
|
487
|
+
|
|
488
|
+
items.push(`0 ${!v ? '=' : '<>'} (
|
|
489
|
+
SELECT COUNT(${alias}.${this.ident(field.name)})
|
|
490
|
+
FROM ${valueTable} ${alias}
|
|
491
|
+
WHERE ${alias}.${pPath} = ${rpPath}
|
|
492
|
+
)`);
|
|
493
|
+
} else {
|
|
494
|
+
items.push(`${sPath} ${v ? SQL_OPS.$isNot : SQL_OPS.$is} NULL`);
|
|
495
|
+
}
|
|
492
496
|
break;
|
|
493
497
|
}
|
|
494
|
-
case '$exists': items.push(`${sPath} ${v ? SQL_OPS.$isNot : SQL_OPS.$is} NULL`); break;
|
|
495
498
|
case '$ne': case '$eq': {
|
|
496
499
|
if (v === null || v === undefined) {
|
|
497
500
|
items.push(`${sPath} ${subKey === '$ne' ? SQL_OPS.$isNot : SQL_OPS.$is} NULL`);
|