@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-sql",
3
- "version": "3.4.4",
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": "^3.4.3",
31
- "@travetto/context": "^3.4.1",
32
- "@travetto/model": "^3.4.4",
33
- "@travetto/model-query": "^3.4.4"
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": "^3.4.2",
37
- "@travetto/test": "^3.4.2"
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": {
@@ -1,4 +1,4 @@
1
- import { RootIndex } from '@travetto/manifest';
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 arr = [...new Set(Array.isArray(v) ? v : [v])].map(el => resolve(el));
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 && RootIndex.getFunctionMetadata(config.type)?.synthetic) {
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
 
@@ -1,4 +1,4 @@
1
- import assert from 'assert';
1
+ import assert from 'node:assert';
2
2
 
3
3
  import { Schema, FieldConfig } from '@travetto/schema';
4
4
  import { Suite, Test } from '@travetto/test';