@travetto/model-sql 3.4.4 → 4.0.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 +4 -3
- package/support/test/query.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-sql",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.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": "^
|
|
31
|
-
"@travetto/context": "^
|
|
32
|
-
"@travetto/model": "^
|
|
33
|
-
"@travetto/model-query": "^
|
|
30
|
+
"@travetto/config": "^4.0.0-rc.0",
|
|
31
|
+
"@travetto/context": "^4.0.0-rc.0",
|
|
32
|
+
"@travetto/model": "^4.0.0-rc.0",
|
|
33
|
+
"@travetto/model-query": "^4.0.0-rc.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@travetto/command": "^
|
|
37
|
-
"@travetto/test": "^
|
|
36
|
+
"@travetto/command": "^4.0.0-rc.0",
|
|
37
|
+
"@travetto/test": "^4.0.0-rc.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
40
40
|
"@travetto/command": {
|
package/src/dialect/base.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RuntimeIndex } from '@travetto/manifest';
|
|
2
2
|
import { SchemaRegistry, FieldConfig, Schema } from '@travetto/schema';
|
|
3
3
|
import { Class, ObjectUtil, AppError, TypedObject, DataUtil } from '@travetto/base';
|
|
4
4
|
import { SelectClause, Query, SortClause, WhereClause, RetainFields } from '@travetto/model-query';
|
|
@@ -440,7 +440,8 @@ export abstract class SQLDialect implements DialectState {
|
|
|
440
440
|
break;
|
|
441
441
|
}
|
|
442
442
|
case '$all': {
|
|
443
|
-
const
|
|
443
|
+
const set = new Set();
|
|
444
|
+
const arr = [v].flat().filter(x => !set.has(x) && !!set.add(x)).map(el => resolve(el));
|
|
444
445
|
const valueTable = this.parentTable(sStack);
|
|
445
446
|
const alias = `_all_${sStack.length}`;
|
|
446
447
|
const pPath = this.ident(this.parentPathField.name);
|
|
@@ -646,7 +647,7 @@ ${this.getLimitSQL(cls, query)}`;
|
|
|
646
647
|
const parent = stack.length > 1;
|
|
647
648
|
const array = parent && config.array;
|
|
648
649
|
|
|
649
|
-
if (config.type &&
|
|
650
|
+
if (config.type && RuntimeIndex.getFunctionMetadata(config.type)?.synthetic) {
|
|
650
651
|
throw new AppError(`Cannot create SQL tables for synthetic types, please convert ${SQLUtil.buildPath(stack)} to a concrete class`);
|
|
651
652
|
}
|
|
652
653
|
|
package/support/test/query.ts
CHANGED