@mikro-orm/sql 7.0.3 → 7.0.4-dev.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.
Files changed (87) hide show
  1. package/AbstractSqlConnection.d.ts +58 -94
  2. package/AbstractSqlConnection.js +238 -235
  3. package/AbstractSqlDriver.d.ts +155 -410
  4. package/AbstractSqlDriver.js +1941 -2064
  5. package/AbstractSqlPlatform.d.ts +73 -83
  6. package/AbstractSqlPlatform.js +158 -162
  7. package/PivotCollectionPersister.d.ts +15 -33
  8. package/PivotCollectionPersister.js +160 -158
  9. package/README.md +1 -1
  10. package/SqlEntityManager.d.ts +22 -67
  11. package/SqlEntityManager.js +38 -54
  12. package/SqlEntityRepository.d.ts +14 -14
  13. package/SqlEntityRepository.js +23 -23
  14. package/dialects/mssql/MsSqlNativeQueryBuilder.d.ts +12 -12
  15. package/dialects/mssql/MsSqlNativeQueryBuilder.js +194 -192
  16. package/dialects/mysql/BaseMySqlPlatform.d.ts +45 -64
  17. package/dialects/mysql/BaseMySqlPlatform.js +131 -134
  18. package/dialects/mysql/MySqlExceptionConverter.d.ts +6 -6
  19. package/dialects/mysql/MySqlExceptionConverter.js +77 -91
  20. package/dialects/mysql/MySqlNativeQueryBuilder.d.ts +3 -3
  21. package/dialects/mysql/MySqlNativeQueryBuilder.js +69 -66
  22. package/dialects/mysql/MySqlSchemaHelper.d.ts +39 -39
  23. package/dialects/mysql/MySqlSchemaHelper.js +319 -327
  24. package/dialects/oracledb/OracleDialect.d.ts +52 -81
  25. package/dialects/oracledb/OracleDialect.js +149 -155
  26. package/dialects/oracledb/OracleNativeQueryBuilder.d.ts +12 -12
  27. package/dialects/oracledb/OracleNativeQueryBuilder.js +236 -232
  28. package/dialects/postgresql/BasePostgreSqlPlatform.d.ts +105 -108
  29. package/dialects/postgresql/BasePostgreSqlPlatform.js +350 -351
  30. package/dialects/postgresql/FullTextType.d.ts +6 -10
  31. package/dialects/postgresql/FullTextType.js +51 -51
  32. package/dialects/postgresql/PostgreSqlExceptionConverter.d.ts +5 -5
  33. package/dialects/postgresql/PostgreSqlExceptionConverter.js +43 -55
  34. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.d.ts +1 -1
  35. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.js +4 -4
  36. package/dialects/postgresql/PostgreSqlSchemaHelper.d.ts +82 -102
  37. package/dialects/postgresql/PostgreSqlSchemaHelper.js +705 -733
  38. package/dialects/sqlite/BaseSqliteConnection.d.ts +5 -3
  39. package/dialects/sqlite/BaseSqliteConnection.js +19 -21
  40. package/dialects/sqlite/NodeSqliteDialect.d.ts +1 -1
  41. package/dialects/sqlite/NodeSqliteDialect.js +23 -23
  42. package/dialects/sqlite/SqliteDriver.d.ts +1 -1
  43. package/dialects/sqlite/SqliteDriver.js +3 -3
  44. package/dialects/sqlite/SqliteExceptionConverter.d.ts +6 -6
  45. package/dialects/sqlite/SqliteExceptionConverter.js +51 -67
  46. package/dialects/sqlite/SqliteNativeQueryBuilder.d.ts +2 -2
  47. package/dialects/sqlite/SqliteNativeQueryBuilder.js +7 -7
  48. package/dialects/sqlite/SqlitePlatform.d.ts +72 -63
  49. package/dialects/sqlite/SqlitePlatform.js +139 -139
  50. package/dialects/sqlite/SqliteSchemaHelper.d.ts +60 -70
  51. package/dialects/sqlite/SqliteSchemaHelper.js +520 -533
  52. package/package.json +3 -3
  53. package/plugin/index.d.ts +35 -42
  54. package/plugin/index.js +36 -43
  55. package/plugin/transformer.d.ts +94 -117
  56. package/plugin/transformer.js +881 -890
  57. package/query/ArrayCriteriaNode.d.ts +4 -4
  58. package/query/ArrayCriteriaNode.js +18 -18
  59. package/query/CriteriaNode.d.ts +25 -35
  60. package/query/CriteriaNode.js +123 -133
  61. package/query/CriteriaNodeFactory.d.ts +6 -49
  62. package/query/CriteriaNodeFactory.js +94 -97
  63. package/query/NativeQueryBuilder.d.ts +118 -118
  64. package/query/NativeQueryBuilder.js +480 -484
  65. package/query/ObjectCriteriaNode.d.ts +12 -12
  66. package/query/ObjectCriteriaNode.js +282 -298
  67. package/query/QueryBuilder.d.ts +904 -1546
  68. package/query/QueryBuilder.js +2164 -2294
  69. package/query/QueryBuilderHelper.d.ts +72 -153
  70. package/query/QueryBuilderHelper.js +1028 -1079
  71. package/query/ScalarCriteriaNode.d.ts +3 -3
  72. package/query/ScalarCriteriaNode.js +46 -53
  73. package/query/enums.d.ts +14 -14
  74. package/query/enums.js +14 -14
  75. package/query/raw.d.ts +6 -16
  76. package/query/raw.js +10 -10
  77. package/schema/DatabaseSchema.d.ts +50 -73
  78. package/schema/DatabaseSchema.js +307 -331
  79. package/schema/DatabaseTable.d.ts +73 -96
  80. package/schema/DatabaseTable.js +927 -1012
  81. package/schema/SchemaComparator.d.ts +66 -70
  82. package/schema/SchemaComparator.js +740 -766
  83. package/schema/SchemaHelper.d.ts +95 -109
  84. package/schema/SchemaHelper.js +659 -675
  85. package/schema/SqlSchemaGenerator.d.ts +58 -78
  86. package/schema/SqlSchemaGenerator.js +501 -535
  87. package/typings.d.ts +266 -380
@@ -4,8 +4,8 @@ import type { IQueryBuilder, ICriteriaNodeProcessOptions } from '../typings.js';
4
4
  * @internal
5
5
  */
6
6
  export declare class ArrayCriteriaNode<T extends object> extends CriteriaNode<T> {
7
- process(qb: IQueryBuilder<T>, options?: ICriteriaNodeProcessOptions): any;
8
- unwrap(): any;
9
- willAutoJoin(qb: IQueryBuilder<T>, alias?: string, options?: ICriteriaNodeProcessOptions): boolean;
10
- isStrict(): boolean;
7
+ process(qb: IQueryBuilder<T>, options?: ICriteriaNodeProcessOptions): any;
8
+ unwrap(): any;
9
+ willAutoJoin(qb: IQueryBuilder<T>, alias?: string, options?: ICriteriaNodeProcessOptions): boolean;
10
+ isStrict(): boolean;
11
11
  }
@@ -3,22 +3,22 @@ import { CriteriaNode } from './CriteriaNode.js';
3
3
  * @internal
4
4
  */
5
5
  export class ArrayCriteriaNode extends CriteriaNode {
6
- process(qb, options) {
7
- return this.payload.map(node => {
8
- return node.process(qb, options);
9
- });
10
- }
11
- unwrap() {
12
- return this.payload.map(node => {
13
- return node.unwrap();
14
- });
15
- }
16
- willAutoJoin(qb, alias, options) {
17
- return this.payload.some(node => {
18
- return node.willAutoJoin(qb, alias, options);
19
- });
20
- }
21
- isStrict() {
22
- return this.strict || this.payload.some(node => node.isStrict());
23
- }
6
+ process(qb, options) {
7
+ return this.payload.map((node) => {
8
+ return node.process(qb, options);
9
+ });
10
+ }
11
+ unwrap() {
12
+ return this.payload.map((node) => {
13
+ return node.unwrap();
14
+ });
15
+ }
16
+ willAutoJoin(qb, alias, options) {
17
+ return this.payload.some((node) => {
18
+ return node.willAutoJoin(qb, alias, options);
19
+ });
20
+ }
21
+ isStrict() {
22
+ return this.strict || this.payload.some((node) => node.isStrict());
23
+ }
24
24
  }
@@ -1,10 +1,4 @@
1
- import {
2
- type EntityKey,
3
- type EntityProperty,
4
- type MetadataStorage,
5
- type RawQueryFragmentSymbol,
6
- type EntityName,
7
- } from '@mikro-orm/core';
1
+ import { type EntityKey, type EntityProperty, type MetadataStorage, type RawQueryFragmentSymbol, type EntityName } from '@mikro-orm/core';
8
2
  import type { ICriteriaNode, ICriteriaNodeProcessOptions, IQueryBuilder } from '../typings.js';
9
3
  /**
10
4
  * Helper for working with deeply nested where/orderBy/having criteria. Uses composite pattern to build tree from the payload.
@@ -12,32 +6,28 @@ import type { ICriteriaNode, ICriteriaNodeProcessOptions, IQueryBuilder } from '
12
6
  * @internal
13
7
  */
14
8
  export declare class CriteriaNode<T extends object> implements ICriteriaNode<T> {
15
- protected readonly metadata: MetadataStorage;
16
- readonly entityName: EntityName<T>;
17
- readonly parent?: ICriteriaNode<T> | undefined;
18
- readonly key?: (EntityKey<T> | RawQueryFragmentSymbol) | undefined;
19
- readonly validate: boolean;
20
- readonly strict: boolean;
21
- payload: any;
22
- prop?: EntityProperty<T>;
23
- index?: number;
24
- constructor(
25
- metadata: MetadataStorage,
26
- entityName: EntityName<T>,
27
- parent?: ICriteriaNode<T> | undefined,
28
- key?: (EntityKey<T> | RawQueryFragmentSymbol) | undefined,
29
- validate?: boolean,
30
- strict?: boolean,
31
- );
32
- process(qb: IQueryBuilder<T>, options?: ICriteriaNodeProcessOptions): any;
33
- unwrap(): any;
34
- shouldInline(payload: any): boolean;
35
- willAutoJoin(qb: IQueryBuilder<T>, alias?: string, options?: ICriteriaNodeProcessOptions): boolean;
36
- shouldRename(payload: any): boolean;
37
- renameFieldToPK<T>(qb: IQueryBuilder<T>, ownerAlias?: string): string;
38
- getPath(opts?: { addIndex?: boolean; parentPath?: string }): string;
39
- private isPivotJoin;
40
- getPivotPath(path: string): string;
41
- aliased(field: string, alias?: string): string;
42
- isStrict(): boolean;
9
+ protected readonly metadata: MetadataStorage;
10
+ readonly entityName: EntityName<T>;
11
+ readonly parent?: ICriteriaNode<T> | undefined;
12
+ readonly key?: (EntityKey<T> | RawQueryFragmentSymbol) | undefined;
13
+ readonly validate: boolean;
14
+ readonly strict: boolean;
15
+ payload: any;
16
+ prop?: EntityProperty<T>;
17
+ index?: number;
18
+ constructor(metadata: MetadataStorage, entityName: EntityName<T>, parent?: ICriteriaNode<T> | undefined, key?: (EntityKey<T> | RawQueryFragmentSymbol) | undefined, validate?: boolean, strict?: boolean);
19
+ process(qb: IQueryBuilder<T>, options?: ICriteriaNodeProcessOptions): any;
20
+ unwrap(): any;
21
+ shouldInline(payload: any): boolean;
22
+ willAutoJoin(qb: IQueryBuilder<T>, alias?: string, options?: ICriteriaNodeProcessOptions): boolean;
23
+ shouldRename(payload: any): boolean;
24
+ renameFieldToPK<T>(qb: IQueryBuilder<T>, ownerAlias?: string): string;
25
+ getPath(opts?: {
26
+ addIndex?: boolean;
27
+ parentPath?: string;
28
+ }): string;
29
+ private isPivotJoin;
30
+ getPivotPath(path: string): string;
31
+ aliased(field: string, alias?: string): string;
32
+ isStrict(): boolean;
43
33
  }
@@ -1,150 +1,140 @@
1
- import { RawQueryFragment, ReferenceKind, Utils, inspect } from '@mikro-orm/core';
1
+ import { RawQueryFragment, ReferenceKind, Utils, inspect, } from '@mikro-orm/core';
2
2
  /**
3
3
  * Helper for working with deeply nested where/orderBy/having criteria. Uses composite pattern to build tree from the payload.
4
4
  * Auto-joins relations and converts payload from { books: { publisher: { name: '...' } } } to { 'publisher_alias.name': '...' }
5
5
  * @internal
6
6
  */
7
7
  export class CriteriaNode {
8
- metadata;
9
- entityName;
10
- parent;
11
- key;
12
- validate;
13
- strict;
14
- payload;
15
- prop;
16
- index;
17
- constructor(metadata, entityName, parent, key, validate = true, strict = false) {
18
- this.metadata = metadata;
19
- this.entityName = entityName;
20
- this.parent = parent;
21
- this.key = key;
22
- this.validate = validate;
23
- this.strict = strict;
24
- const meta = parent && metadata.find(parent.entityName);
25
- if (meta && key && !RawQueryFragment.isKnownFragmentSymbol(key)) {
26
- const pks = Utils.splitPrimaryKeys(key);
27
- if (pks.length > 1) {
28
- return;
29
- }
30
- for (const k of pks) {
31
- this.prop = meta.props.find(
32
- prop =>
33
- prop.name === k || (prop.fieldNames?.length === 1 && prop.fieldNames[0] === k && prop.persist !== false),
34
- );
35
- const isProp = this.prop || meta.props.find(prop => (prop.fieldNames || []).includes(k));
36
- // do not validate if the key is prefixed or type casted (e.g. `k::text`)
37
- if (validate && !isProp && !k.includes('.') && !k.includes('::') && !Utils.isOperator(k)) {
38
- throw new Error(`Trying to query by not existing property ${Utils.className(entityName)}.${k}`);
8
+ metadata;
9
+ entityName;
10
+ parent;
11
+ key;
12
+ validate;
13
+ strict;
14
+ payload;
15
+ prop;
16
+ index;
17
+ constructor(metadata, entityName, parent, key, validate = true, strict = false) {
18
+ this.metadata = metadata;
19
+ this.entityName = entityName;
20
+ this.parent = parent;
21
+ this.key = key;
22
+ this.validate = validate;
23
+ this.strict = strict;
24
+ const meta = parent && metadata.find(parent.entityName);
25
+ if (meta && key && !RawQueryFragment.isKnownFragmentSymbol(key)) {
26
+ const pks = Utils.splitPrimaryKeys(key);
27
+ if (pks.length > 1) {
28
+ return;
29
+ }
30
+ for (const k of pks) {
31
+ this.prop = meta.props.find(prop => prop.name === k || (prop.fieldNames?.length === 1 && prop.fieldNames[0] === k && prop.persist !== false));
32
+ const isProp = this.prop || meta.props.find(prop => (prop.fieldNames || []).includes(k));
33
+ // do not validate if the key is prefixed or type casted (e.g. `k::text`)
34
+ if (validate && !isProp && !k.includes('.') && !k.includes('::') && !Utils.isOperator(k)) {
35
+ throw new Error(`Trying to query by not existing property ${Utils.className(entityName)}.${k}`);
36
+ }
37
+ }
39
38
  }
40
- }
41
39
  }
42
- }
43
- process(qb, options) {
44
- return this.payload;
45
- }
46
- unwrap() {
47
- return this.payload;
48
- }
49
- shouldInline(payload) {
50
- return false;
51
- }
52
- willAutoJoin(qb, alias, options) {
53
- return false;
54
- }
55
- shouldRename(payload) {
56
- const type = this.prop ? this.prop.kind : null;
57
- const composite = this.prop?.joinColumns ? this.prop.joinColumns.length > 1 : false;
58
- const rawField = RawQueryFragment.isKnownFragmentSymbol(this.key);
59
- const scalar =
60
- payload === null ||
61
- Utils.isPrimaryKey(payload) ||
62
- payload instanceof RegExp ||
63
- payload instanceof Date ||
64
- rawField;
65
- const operator =
66
- Utils.isPlainObject(payload) && Utils.getObjectQueryKeys(payload).every(k => Utils.isOperator(k, false));
67
- if (composite) {
68
- return true;
40
+ process(qb, options) {
41
+ return this.payload;
69
42
  }
70
- switch (type) {
71
- case ReferenceKind.MANY_TO_ONE:
43
+ unwrap() {
44
+ return this.payload;
45
+ }
46
+ shouldInline(payload) {
72
47
  return false;
73
- case ReferenceKind.ONE_TO_ONE:
74
- return !this.prop.owner;
75
- case ReferenceKind.ONE_TO_MANY:
76
- return scalar || operator;
77
- case ReferenceKind.MANY_TO_MANY:
78
- return scalar || operator;
79
- default:
48
+ }
49
+ willAutoJoin(qb, alias, options) {
80
50
  return false;
81
51
  }
82
- }
83
- renameFieldToPK(qb, ownerAlias) {
84
- const joinAlias = qb.getAliasForJoinPath(this.getPath(), { matchPopulateJoins: true });
85
- if (
86
- !joinAlias &&
87
- this.parent &&
88
- [ReferenceKind.MANY_TO_ONE, ReferenceKind.ONE_TO_ONE].includes(this.prop.kind) &&
89
- this.prop.owner
90
- ) {
91
- const alias = qb.getAliasForJoinPath(this.parent.getPath()) ?? ownerAlias ?? qb.alias;
92
- return Utils.getPrimaryKeyHash(this.prop.joinColumns.map(col => `${alias}.${col}`));
52
+ shouldRename(payload) {
53
+ const type = this.prop ? this.prop.kind : null;
54
+ const composite = this.prop?.joinColumns ? this.prop.joinColumns.length > 1 : false;
55
+ const rawField = RawQueryFragment.isKnownFragmentSymbol(this.key);
56
+ const scalar = payload === null ||
57
+ Utils.isPrimaryKey(payload) ||
58
+ payload instanceof RegExp ||
59
+ payload instanceof Date ||
60
+ rawField;
61
+ const operator = Utils.isPlainObject(payload) && Utils.getObjectQueryKeys(payload).every(k => Utils.isOperator(k, false));
62
+ if (composite) {
63
+ return true;
64
+ }
65
+ switch (type) {
66
+ case ReferenceKind.MANY_TO_ONE:
67
+ return false;
68
+ case ReferenceKind.ONE_TO_ONE:
69
+ return !this.prop.owner;
70
+ case ReferenceKind.ONE_TO_MANY:
71
+ return scalar || operator;
72
+ case ReferenceKind.MANY_TO_MANY:
73
+ return scalar || operator;
74
+ default:
75
+ return false;
76
+ }
77
+ }
78
+ renameFieldToPK(qb, ownerAlias) {
79
+ const joinAlias = qb.getAliasForJoinPath(this.getPath(), { matchPopulateJoins: true });
80
+ if (!joinAlias &&
81
+ this.parent &&
82
+ [ReferenceKind.MANY_TO_ONE, ReferenceKind.ONE_TO_ONE].includes(this.prop.kind) &&
83
+ this.prop.owner) {
84
+ const alias = qb.getAliasForJoinPath(this.parent.getPath()) ?? ownerAlias ?? qb.alias;
85
+ return Utils.getPrimaryKeyHash(this.prop.joinColumns.map(col => `${alias}.${col}`));
86
+ }
87
+ const alias = joinAlias ?? ownerAlias ?? qb.alias;
88
+ if (this.prop.kind === ReferenceKind.MANY_TO_MANY) {
89
+ return Utils.getPrimaryKeyHash(this.prop.inverseJoinColumns.map(col => `${alias}.${col}`));
90
+ }
91
+ return Utils.getPrimaryKeyHash(this.prop.referencedColumnNames.map(col => `${alias}.${col}`));
92
+ }
93
+ getPath(opts) {
94
+ // use index on parent only if we are processing to-many relation
95
+ const addParentIndex = this.prop && [ReferenceKind.ONE_TO_MANY, ReferenceKind.MANY_TO_MANY].includes(this.prop.kind);
96
+ const parentPath = opts?.parentPath ?? this.parent?.getPath({ addIndex: addParentIndex }) ?? Utils.className(this.entityName);
97
+ const index = opts?.addIndex && this.index != null ? `[${this.index}]` : '';
98
+ // ignore group operators to allow easier mapping (e.g. for orderBy)
99
+ const key = this.key && !RawQueryFragment.isKnownFragmentSymbol(this.key) && !['$and', '$or', '$not'].includes(this.key)
100
+ ? '.' + this.key
101
+ : '';
102
+ const ret = parentPath + index + key;
103
+ if (this.isPivotJoin()) {
104
+ // distinguish pivot table join from target entity join
105
+ return this.getPivotPath(ret);
106
+ }
107
+ return ret;
108
+ }
109
+ isPivotJoin() {
110
+ if (!this.key || !this.prop) {
111
+ return false;
112
+ }
113
+ const rawField = RawQueryFragment.isKnownFragmentSymbol(this.key);
114
+ const scalar = this.payload === null ||
115
+ Utils.isPrimaryKey(this.payload) ||
116
+ this.payload instanceof RegExp ||
117
+ this.payload instanceof Date ||
118
+ rawField;
119
+ const operator = Utils.isObject(this.payload) && Utils.getObjectQueryKeys(this.payload).every(k => Utils.isOperator(k, false));
120
+ return this.prop.kind === ReferenceKind.MANY_TO_MANY && (scalar || operator);
121
+ }
122
+ getPivotPath(path) {
123
+ return `${path}[pivot]`;
93
124
  }
94
- const alias = joinAlias ?? ownerAlias ?? qb.alias;
95
- if (this.prop.kind === ReferenceKind.MANY_TO_MANY) {
96
- return Utils.getPrimaryKeyHash(this.prop.inverseJoinColumns.map(col => `${alias}.${col}`));
125
+ aliased(field, alias) {
126
+ return alias ? `${alias}.${field}` : field;
97
127
  }
98
- return Utils.getPrimaryKeyHash(this.prop.referencedColumnNames.map(col => `${alias}.${col}`));
99
- }
100
- getPath(opts) {
101
- // use index on parent only if we are processing to-many relation
102
- const addParentIndex =
103
- this.prop && [ReferenceKind.ONE_TO_MANY, ReferenceKind.MANY_TO_MANY].includes(this.prop.kind);
104
- const parentPath =
105
- opts?.parentPath ?? this.parent?.getPath({ addIndex: addParentIndex }) ?? Utils.className(this.entityName);
106
- const index = opts?.addIndex && this.index != null ? `[${this.index}]` : '';
107
- // ignore group operators to allow easier mapping (e.g. for orderBy)
108
- const key =
109
- this.key && !RawQueryFragment.isKnownFragmentSymbol(this.key) && !['$and', '$or', '$not'].includes(this.key)
110
- ? '.' + this.key
111
- : '';
112
- const ret = parentPath + index + key;
113
- if (this.isPivotJoin()) {
114
- // distinguish pivot table join from target entity join
115
- return this.getPivotPath(ret);
128
+ isStrict() {
129
+ return this.strict;
116
130
  }
117
- return ret;
118
- }
119
- isPivotJoin() {
120
- if (!this.key || !this.prop) {
121
- return false;
131
+ /** @ignore */
132
+ /* v8 ignore next */
133
+ [Symbol.for('nodejs.util.inspect.custom')]() {
134
+ const o = {};
135
+ ['entityName', 'key', 'index', 'payload']
136
+ .filter(k => this[k] !== undefined)
137
+ .forEach(k => (o[k] = this[k]));
138
+ return `${this.constructor.name} ${inspect(o)}`;
122
139
  }
123
- const rawField = RawQueryFragment.isKnownFragmentSymbol(this.key);
124
- const scalar =
125
- this.payload === null ||
126
- Utils.isPrimaryKey(this.payload) ||
127
- this.payload instanceof RegExp ||
128
- this.payload instanceof Date ||
129
- rawField;
130
- const operator =
131
- Utils.isObject(this.payload) && Utils.getObjectQueryKeys(this.payload).every(k => Utils.isOperator(k, false));
132
- return this.prop.kind === ReferenceKind.MANY_TO_MANY && (scalar || operator);
133
- }
134
- getPivotPath(path) {
135
- return `${path}[pivot]`;
136
- }
137
- aliased(field, alias) {
138
- return alias ? `${alias}.${field}` : field;
139
- }
140
- isStrict() {
141
- return this.strict;
142
- }
143
- /** @ignore */
144
- /* v8 ignore next */
145
- [Symbol.for('nodejs.util.inspect.custom')]() {
146
- const o = {};
147
- ['entityName', 'key', 'index', 'payload'].filter(k => this[k] !== undefined).forEach(k => (o[k] = this[k]));
148
- return `${this.constructor.name} ${inspect(o)}`;
149
- }
150
140
  }
@@ -1,55 +1,12 @@
1
- import {
2
- type Dictionary,
3
- type EntityKey,
4
- type EntityMetadata,
5
- type EntityName,
6
- type MetadataStorage,
7
- type RawQueryFragmentSymbol,
8
- } from '@mikro-orm/core';
1
+ import { type Dictionary, type EntityKey, type EntityMetadata, type EntityName, type MetadataStorage, type RawQueryFragmentSymbol } from '@mikro-orm/core';
9
2
  import type { ICriteriaNode } from '../typings.js';
10
3
  /**
11
4
  * @internal
12
5
  */
13
6
  export declare class CriteriaNodeFactory {
14
- static createNode<T extends object>(
15
- metadata: MetadataStorage,
16
- entityName: EntityName<T>,
17
- payload: any,
18
- parent?: ICriteriaNode<T>,
19
- key?: EntityKey<T> | RawQueryFragmentSymbol,
20
- validate?: boolean,
21
- ): ICriteriaNode<T>;
22
- static createScalarNode<T extends object>(
23
- metadata: MetadataStorage,
24
- entityName: EntityName<T>,
25
- payload: any,
26
- parent?: ICriteriaNode<T>,
27
- key?: EntityKey<T> | RawQueryFragmentSymbol,
28
- validate?: boolean,
29
- ): ICriteriaNode<T>;
30
- static createArrayNode<T extends object>(
31
- metadata: MetadataStorage,
32
- entityName: EntityName<T>,
33
- payload: any[],
34
- parent?: ICriteriaNode<T>,
35
- key?: EntityKey<T>,
36
- validate?: boolean,
37
- ): ICriteriaNode<T>;
38
- static createObjectNode<T extends object>(
39
- metadata: MetadataStorage,
40
- entityName: EntityName<T>,
41
- payload: Dictionary,
42
- parent?: ICriteriaNode<T>,
43
- key?: EntityKey<T>,
44
- validate?: boolean,
45
- ): ICriteriaNode<T>;
46
- static createObjectItemNode<T extends object>(
47
- metadata: MetadataStorage,
48
- entityName: EntityName<T>,
49
- node: ICriteriaNode<T>,
50
- payload: Dictionary,
51
- key: EntityKey<T> | RawQueryFragmentSymbol,
52
- meta?: EntityMetadata<T>,
53
- validate?: boolean,
54
- ): ICriteriaNode<T>;
7
+ static createNode<T extends object>(metadata: MetadataStorage, entityName: EntityName<T>, payload: any, parent?: ICriteriaNode<T>, key?: EntityKey<T> | RawQueryFragmentSymbol, validate?: boolean): ICriteriaNode<T>;
8
+ static createScalarNode<T extends object>(metadata: MetadataStorage, entityName: EntityName<T>, payload: any, parent?: ICriteriaNode<T>, key?: EntityKey<T> | RawQueryFragmentSymbol, validate?: boolean): ICriteriaNode<T>;
9
+ static createArrayNode<T extends object>(metadata: MetadataStorage, entityName: EntityName<T>, payload: any[], parent?: ICriteriaNode<T>, key?: EntityKey<T>, validate?: boolean): ICriteriaNode<T>;
10
+ static createObjectNode<T extends object>(metadata: MetadataStorage, entityName: EntityName<T>, payload: Dictionary, parent?: ICriteriaNode<T>, key?: EntityKey<T>, validate?: boolean): ICriteriaNode<T>;
11
+ static createObjectItemNode<T extends object>(metadata: MetadataStorage, entityName: EntityName<T>, node: ICriteriaNode<T>, payload: Dictionary, key: EntityKey<T> | RawQueryFragmentSymbol, meta?: EntityMetadata<T>, validate?: boolean): ICriteriaNode<T>;
55
12
  }