metal-orm 1.1.9 → 1.1.10

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 (73) hide show
  1. package/README.md +769 -764
  2. package/dist/index.cjs +2147 -239
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +559 -39
  5. package/dist/index.d.ts +559 -39
  6. package/dist/index.js +2119 -239
  7. package/dist/index.js.map +1 -1
  8. package/package.json +17 -12
  9. package/src/bulk/bulk-context.ts +83 -0
  10. package/src/bulk/bulk-delete-executor.ts +89 -0
  11. package/src/bulk/bulk-executor.base.ts +73 -0
  12. package/src/bulk/bulk-insert-executor.ts +74 -0
  13. package/src/bulk/bulk-types.ts +70 -0
  14. package/src/bulk/bulk-update-executor.ts +192 -0
  15. package/src/bulk/bulk-upsert-executor.ts +95 -0
  16. package/src/bulk/bulk-utils.ts +91 -0
  17. package/src/bulk/index.ts +18 -0
  18. package/src/codegen/typescript.ts +30 -21
  19. package/src/core/ast/expression-builders.ts +107 -10
  20. package/src/core/ast/expression-nodes.ts +52 -22
  21. package/src/core/ast/expression-visitor.ts +23 -13
  22. package/src/core/dialect/abstract.ts +30 -17
  23. package/src/core/dialect/mysql/index.ts +20 -5
  24. package/src/core/execution/db-executor.ts +96 -64
  25. package/src/core/execution/executors/better-sqlite3-executor.ts +94 -0
  26. package/src/core/execution/executors/mssql-executor.ts +66 -34
  27. package/src/core/execution/executors/mysql-executor.ts +98 -66
  28. package/src/core/execution/executors/postgres-executor.ts +33 -11
  29. package/src/core/execution/executors/sqlite-executor.ts +86 -30
  30. package/src/decorators/bootstrap.ts +482 -398
  31. package/src/decorators/column-decorator.ts +87 -96
  32. package/src/decorators/decorator-metadata.ts +100 -24
  33. package/src/decorators/entity.ts +27 -24
  34. package/src/decorators/relations.ts +231 -149
  35. package/src/decorators/transformers/transformer-decorators.ts +26 -29
  36. package/src/decorators/validators/country-validators-decorators.ts +9 -15
  37. package/src/dto/apply-filter.ts +568 -551
  38. package/src/index.ts +16 -9
  39. package/src/orm/entity-hydration.ts +116 -72
  40. package/src/orm/entity-metadata.ts +347 -301
  41. package/src/orm/entity-relations.ts +264 -207
  42. package/src/orm/entity.ts +199 -199
  43. package/src/orm/execute.ts +13 -13
  44. package/src/orm/lazy-batch/morph-many.ts +70 -0
  45. package/src/orm/lazy-batch/morph-one.ts +69 -0
  46. package/src/orm/lazy-batch/morph-to.ts +59 -0
  47. package/src/orm/lazy-batch.ts +4 -1
  48. package/src/orm/orm-session.ts +170 -104
  49. package/src/orm/pooled-executor-factory.ts +99 -58
  50. package/src/orm/query-logger.ts +49 -40
  51. package/src/orm/relation-change-processor.ts +198 -96
  52. package/src/orm/relations/belongs-to.ts +143 -143
  53. package/src/orm/relations/has-many.ts +204 -204
  54. package/src/orm/relations/has-one.ts +174 -174
  55. package/src/orm/relations/many-to-many.ts +288 -288
  56. package/src/orm/relations/morph-many.ts +156 -0
  57. package/src/orm/relations/morph-one.ts +151 -0
  58. package/src/orm/relations/morph-to.ts +162 -0
  59. package/src/orm/save-graph.ts +116 -1
  60. package/src/query-builder/expression-table-mapper.ts +5 -0
  61. package/src/query-builder/hydration-manager.ts +345 -345
  62. package/src/query-builder/hydration-planner.ts +178 -148
  63. package/src/query-builder/relation-conditions.ts +171 -151
  64. package/src/query-builder/relation-cte-builder.ts +5 -1
  65. package/src/query-builder/relation-filter-utils.ts +9 -6
  66. package/src/query-builder/relation-include-strategies.ts +44 -2
  67. package/src/query-builder/relation-join-strategies.ts +8 -1
  68. package/src/query-builder/relation-service.ts +250 -241
  69. package/src/query-builder/select/select-operations.ts +110 -105
  70. package/src/query-builder/update-include.ts +4 -0
  71. package/src/schema/relation.ts +296 -188
  72. package/src/schema/types.ts +138 -123
  73. package/src/tree/tree-decorator.ts +127 -137
package/dist/index.d.cts CHANGED
@@ -212,6 +212,12 @@ declare const RelationKinds: {
212
212
  readonly BelongsTo: "BELONGS_TO";
213
213
  /** Many-to-many relationship with pivot metadata */
214
214
  readonly BelongsToMany: "BELONGS_TO_MANY";
215
+ /** Polymorphic inverse (child side) */
216
+ readonly MorphTo: "MORPH_TO";
217
+ /** Polymorphic one-to-one (parent side) */
218
+ readonly MorphOne: "MORPH_ONE";
219
+ /** Polymorphic one-to-many (parent side) */
220
+ readonly MorphMany: "MORPH_MANY";
215
221
  };
216
222
  /**
217
223
  * Type representing the supported relationship kinds
@@ -263,10 +269,48 @@ interface BelongsToManyRelation<TTarget extends TableDef = TableDef, TPivot exte
263
269
  defaultPivotColumns?: string[];
264
270
  cascade?: CascadeMode;
265
271
  }
272
+ /**
273
+ * Polymorphic inverse relationship (child side).
274
+ * The child row stores a type + id pair that can point to any of the listed targets.
275
+ */
276
+ interface MorphToRelation<TTargets extends Record<string, TableDef> = Record<string, TableDef>> {
277
+ type: typeof RelationKinds.MorphTo;
278
+ typeField: string;
279
+ idField: string;
280
+ targets: TTargets;
281
+ targetKey?: string;
282
+ cascade?: CascadeMode;
283
+ }
284
+ /**
285
+ * Polymorphic one-to-one relationship (parent side).
286
+ */
287
+ interface MorphOneRelation<TTarget extends TableDef = TableDef> {
288
+ type: typeof RelationKinds.MorphOne;
289
+ target: TTarget;
290
+ morphName: string;
291
+ typeField: string;
292
+ idField: string;
293
+ typeValue: string;
294
+ localKey?: string;
295
+ cascade?: CascadeMode;
296
+ }
297
+ /**
298
+ * Polymorphic one-to-many relationship (parent side).
299
+ */
300
+ interface MorphManyRelation<TTarget extends TableDef = TableDef> {
301
+ type: typeof RelationKinds.MorphMany;
302
+ target: TTarget;
303
+ morphName: string;
304
+ typeField: string;
305
+ idField: string;
306
+ typeValue: string;
307
+ localKey?: string;
308
+ cascade?: CascadeMode;
309
+ }
266
310
  /**
267
311
  * Union type representing any supported relationship definition
268
312
  */
269
- type RelationDef = HasManyRelation | HasOneRelation | BelongsToRelation | BelongsToManyRelation;
313
+ type RelationDef = HasManyRelation | HasOneRelation | BelongsToRelation | BelongsToManyRelation | MorphToRelation | MorphOneRelation | MorphManyRelation;
270
314
  /**
271
315
  * Creates a one-to-many relationship definition
272
316
  * @param target - Target table of the relationship
@@ -317,6 +361,31 @@ declare const belongsToMany: <TTarget extends TableDef, TPivot extends TableDef
317
361
  defaultPivotColumns?: string[];
318
362
  cascade?: CascadeMode;
319
363
  }) => BelongsToManyRelation<TTarget, TPivot>;
364
+ declare const isSingleTargetRelation: (rel: RelationDef) => rel is Exclude<RelationDef, MorphToRelation>;
365
+ declare const isMorphRelation: (rel: RelationDef) => rel is MorphToRelation | MorphOneRelation | MorphManyRelation;
366
+ declare const morphTo: <TTargets extends Record<string, TableDef>>(opts: {
367
+ typeField: string;
368
+ idField: string;
369
+ targets: TTargets;
370
+ targetKey?: string;
371
+ cascade?: CascadeMode;
372
+ }) => MorphToRelation<TTargets>;
373
+ declare const morphOne: <TTarget extends TableDef>(target: TTarget, opts: {
374
+ as: string;
375
+ typeValue: string;
376
+ localKey?: string;
377
+ typeField?: string;
378
+ idField?: string;
379
+ cascade?: CascadeMode;
380
+ }) => MorphOneRelation<TTarget>;
381
+ declare const morphMany: <TTarget extends TableDef>(target: TTarget, opts: {
382
+ as: string;
383
+ typeValue: string;
384
+ localKey?: string;
385
+ typeField?: string;
386
+ idField?: string;
387
+ cascade?: CascadeMode;
388
+ }) => MorphManyRelation<TTarget>;
320
389
 
321
390
  interface IndexColumn {
322
391
  column: string;
@@ -458,7 +527,7 @@ declare function getColumn<T extends TableDef>(table: T, key: string): ColumnDef
458
527
  /**
459
528
  * Resolves a relation definition to its target table type.
460
529
  */
461
- type RelationTargetTable<TRel extends RelationDef> = TRel extends HasManyRelation<infer TTarget> ? TTarget : TRel extends HasOneRelation<infer TTarget> ? TTarget : TRel extends BelongsToRelation<infer TTarget> ? TTarget : TRel extends BelongsToManyRelation<infer TTarget, TableDef> ? TTarget : never;
530
+ type RelationTargetTable<TRel extends RelationDef> = TRel extends HasManyRelation<infer TTarget> ? TTarget : TRel extends HasOneRelation<infer TTarget> ? TTarget : TRel extends BelongsToRelation<infer TTarget> ? TTarget : TRel extends BelongsToManyRelation<infer TTarget, TableDef> ? TTarget : TRel extends MorphOneRelation<infer TTarget> ? TTarget : TRel extends MorphManyRelation<infer TTarget> ? TTarget : TRel extends MorphToRelation ? never : never;
462
531
  type JsonValue = string | number | boolean | null | JsonArray | JsonObject;
463
532
  type JsonArray = Array<JsonValue>;
464
533
  interface JsonObject {
@@ -479,7 +548,7 @@ type InferRow<TTable extends TableDef> = {
479
548
  };
480
549
  type RelationResult$1<T extends RelationDef> = T extends HasManyRelation<infer TTarget> ? InferRow<TTarget>[] : T extends HasOneRelation<infer TTarget> ? InferRow<TTarget> | null : T extends BelongsToRelation<infer TTarget> ? InferRow<TTarget> | null : T extends BelongsToManyRelation<infer TTarget, infer TPivot> ? (InferRow<TTarget> & {
481
550
  _pivot?: InferRow<TPivot>;
482
- })[] : never;
551
+ })[] : T extends MorphOneRelation<infer TTarget> ? InferRow<TTarget> | null : T extends MorphManyRelation<infer TTarget> ? InferRow<TTarget>[] : T extends MorphToRelation ? Record<string, unknown> | null : never;
483
552
  /**
484
553
  * Maps relation names to the expected row results
485
554
  */
@@ -490,7 +559,7 @@ type RelationWrapper$1<TRel extends RelationDef> = TRel extends HasManyRelation<
490
559
  _pivot?: InferRow<TPivot>;
491
560
  }> & ReadonlyArray<EntityInstance<TTarget> & {
492
561
  _pivot?: InferRow<TPivot>;
493
- }> : TRel extends BelongsToRelation<infer TTarget> ? BelongsToReference<EntityInstance<TTarget>> : never;
562
+ }> : TRel extends BelongsToRelation<infer TTarget> ? BelongsToReference<EntityInstance<TTarget>> : TRel extends MorphOneRelation<infer TTarget> ? HasOneReference<EntityInstance<TTarget>> : TRel extends MorphManyRelation<infer TTarget> ? HasManyCollection<EntityInstance<TTarget>> & ReadonlyArray<EntityInstance<TTarget>> : TRel extends MorphToRelation ? BelongsToReference<EntityInstance<TableDef>> : never;
494
563
  interface HasManyCollection<TChild> {
495
564
  length: number;
496
565
  [Symbol.iterator](): Iterator<TChild>;
@@ -849,6 +918,14 @@ interface LogicalExpressionNode {
849
918
  /** Operands to combine */
850
919
  operands: ExpressionNode[];
851
920
  }
921
+ /**
922
+ * AST node representing a unary NOT expression
923
+ */
924
+ interface NotExpressionNode {
925
+ type: 'NotExpression';
926
+ /** Expression to negate */
927
+ operand: ExpressionNode;
928
+ }
852
929
  /**
853
930
  * AST node representing a null check expression
854
931
  */
@@ -895,10 +972,25 @@ interface BetweenExpressionNode {
895
972
  /** Upper bound */
896
973
  upper: OperandNode;
897
974
  }
975
+ /**
976
+ * AST node representing an IS DISTINCT FROM / IS NOT DISTINCT FROM expression
977
+ */
978
+ interface IsDistinctExpressionNode {
979
+ type: 'IsDistinctExpression';
980
+ /** The operand on the left side. */
981
+ left: OperandNode;
982
+ /**
983
+ * `'IS DISTINCT FROM'` → true when values are different, even if one is NULL.
984
+ * `'IS NOT DISTINCT FROM'` → true when values are equal, treating NULL = NULL.
985
+ */
986
+ operator: 'IS DISTINCT FROM' | 'IS NOT DISTINCT FROM';
987
+ /** The operand on the right side. */
988
+ right: OperandNode;
989
+ }
898
990
  /**
899
991
  * Union type representing any supported expression node
900
992
  */
901
- type ExpressionNode = BinaryExpressionNode | LogicalExpressionNode | NullExpressionNode | InExpressionNode | ExistsExpressionNode | BetweenExpressionNode | ArithmeticExpressionNode | BitwiseExpressionNode;
993
+ type ExpressionNode = BinaryExpressionNode | LogicalExpressionNode | NotExpressionNode | NullExpressionNode | InExpressionNode | ExistsExpressionNode | BetweenExpressionNode | ArithmeticExpressionNode | BitwiseExpressionNode | IsDistinctExpressionNode;
902
994
 
903
995
  type LiteralValue = LiteralNode['value'];
904
996
  type ValueOperandInput = OperandNode | LiteralValue;
@@ -1068,6 +1160,19 @@ declare const and: (...operands: ExpressionNode[]) => LogicalExpressionNode;
1068
1160
  * );
1069
1161
  */
1070
1162
  declare const or: (...operands: ExpressionNode[]) => LogicalExpressionNode;
1163
+ /**
1164
+ * Creates a unary NOT expression (`NOT (expr)`).
1165
+ *
1166
+ * @param operand - Expression to negate.
1167
+ * @returns A `NotExpressionNode`.
1168
+ *
1169
+ * @example
1170
+ * not(or(
1171
+ * eq(users.status, 'inactive'),
1172
+ * eq(users.role, 'guest')
1173
+ * ));
1174
+ */
1175
+ declare const not: (operand: ExpressionNode) => NotExpressionNode;
1071
1176
  /**
1072
1177
  * Creates an IS NULL check (`left IS NULL`).
1073
1178
  *
@@ -1308,6 +1413,66 @@ declare const notExists: (subquery: SelectQueryNode) => ExistsExpressionNode;
1308
1413
  * collate(users.email, 'nocase');
1309
1414
  */
1310
1415
  declare const collate: (expression: OperandNode | ColumnRef | string | number | boolean | null, collation: string) => CollateExpressionNode;
1416
+ /**
1417
+ * Creates an `IS DISTINCT FROM` expression.
1418
+ *
1419
+ * Unlike `neq(a, b)`, this comparison is **null-safe**:
1420
+ * returns `true` when values are different **including** when one
1421
+ * (or both) is `NULL`. Never returns `NULL`.
1422
+ *
1423
+ * | left | right | neq | isDistinctFrom |
1424
+ * |-------|-------|-------|----------------|
1425
+ * | 1 | 2 | true | true |
1426
+ * | 1 | 1 | false | false |
1427
+ * | NULL | 1 | NULL | **true** |
1428
+ * | NULL | NULL | NULL | **false** |
1429
+ *
1430
+ * Compilation by dialect:
1431
+ * - PostgreSQL / SQLite / MSSQL → `left IS DISTINCT FROM right`
1432
+ * - MySQL → `NOT (left <=> right)`
1433
+ *
1434
+ * @param left - The left operand.
1435
+ * @param right - The right operand.
1436
+ * @returns An `IsDistinctExpressionNode`.
1437
+ *
1438
+ * @example
1439
+ * ```ts
1440
+ * // Find users whose email has changed compared to backup
1441
+ * where(isDistinctFrom(users.columns.email, backup.columns.email))
1442
+ * ```
1443
+ */
1444
+ declare const isDistinctFrom: (left: OperandNode | ColumnRef, right: OperandNode | ColumnRef | LiteralValue) => IsDistinctExpressionNode;
1445
+ /**
1446
+ * Creates an `IS NOT DISTINCT FROM` expression.
1447
+ *
1448
+ * The inverse of `isDistinctFrom`. Equivalent to a **null-safe** equality:
1449
+ * returns `true` when values are equal **including** when both
1450
+ * are `NULL`. Never returns `NULL`.
1451
+ *
1452
+ * | left | right | eq | isNotDistinctFrom |
1453
+ * |-------|-------|-------|------------------|
1454
+ * | 1 | 1 | true | true |
1455
+ * | 1 | 2 | false | false |
1456
+ * | NULL | 1 | NULL | **false** |
1457
+ * | NULL | NULL | NULL | **true** |
1458
+ *
1459
+ * Compilation by dialect:
1460
+ * - PostgreSQL / SQLite / MSSQL → `left IS NOT DISTINCT FROM right`
1461
+ * - MySQL → `left <=> right`
1462
+ *
1463
+ * @param left - The left operand.
1464
+ * @param right - The right operand.
1465
+ * @returns An `IsDistinctExpressionNode`.
1466
+ *
1467
+ * @example
1468
+ * ```ts
1469
+ * // Rows where deletedAt is NULL or equal to a specific date
1470
+ * where(isNotDistinctFrom(orders.columns.deletedAt, null))
1471
+ * // → WHERE "orders"."deletedAt" IS NOT DISTINCT FROM NULL
1472
+ * // equivalent to: WHERE deletedAt IS NULL (but works with any value)
1473
+ * ```
1474
+ */
1475
+ declare const isNotDistinctFrom: (left: OperandNode | ColumnRef, right: OperandNode | ColumnRef | LiteralValue) => IsDistinctExpressionNode;
1311
1476
 
1312
1477
  /**
1313
1478
  * Creates a ROW_NUMBER window function.
@@ -1454,12 +1619,14 @@ declare const variance: (col: ColumnRef | ColumnNode) => TypedExpression<number>
1454
1619
  interface ExpressionVisitor<R> {
1455
1620
  visitBinaryExpression?(node: BinaryExpressionNode): R;
1456
1621
  visitLogicalExpression?(node: LogicalExpressionNode): R;
1622
+ visitNotExpression?(node: NotExpressionNode): R;
1457
1623
  visitNullExpression?(node: NullExpressionNode): R;
1458
1624
  visitInExpression?(node: InExpressionNode): R;
1459
1625
  visitExistsExpression?(node: ExistsExpressionNode): R;
1460
1626
  visitBetweenExpression?(node: BetweenExpressionNode): R;
1461
1627
  visitArithmeticExpression?(node: ArithmeticExpressionNode): R;
1462
1628
  visitBitwiseExpression?(node: BitwiseExpressionNode): R;
1629
+ visitIsDistinctExpression?(node: IsDistinctExpressionNode): R;
1463
1630
  otherwise?(node: ExpressionNode): R;
1464
1631
  }
1465
1632
  /**
@@ -2777,11 +2944,16 @@ interface DbExecutor {
2777
2944
  readonly capabilities: {
2778
2945
  /** True if begin/commit/rollback are real and should be used to provide atomicity. */
2779
2946
  transactions: boolean;
2947
+ /** True if savepoint/release/rollback-to-savepoint are implemented. */
2948
+ savepoints?: boolean;
2780
2949
  };
2781
2950
  executeSql(sql: string, params?: unknown[]): Promise<ExecutionPayload>;
2782
2951
  beginTransaction(): Promise<void>;
2783
2952
  commitTransaction(): Promise<void>;
2784
2953
  rollbackTransaction(): Promise<void>;
2954
+ savepoint?(name: string): Promise<void>;
2955
+ releaseSavepoint?(name: string): Promise<void>;
2956
+ rollbackToSavepoint?(name: string): Promise<void>;
2785
2957
  /** Release any underlying resources (connections, pool leases, etc). Must be idempotent. */
2786
2958
  dispose(): Promise<void>;
2787
2959
  }
@@ -2798,6 +2970,9 @@ interface SimpleQueryRunner {
2798
2970
  beginTransaction?(): Promise<void>;
2799
2971
  commitTransaction?(): Promise<void>;
2800
2972
  rollbackTransaction?(): Promise<void>;
2973
+ savepoint?(name: string): Promise<void>;
2974
+ releaseSavepoint?(name: string): Promise<void>;
2975
+ rollbackToSavepoint?(name: string): Promise<void>;
2801
2976
  /** Optional: release resources (connection close, pool lease release, etc). */
2802
2977
  dispose?(): Promise<void>;
2803
2978
  }
@@ -2943,10 +3118,50 @@ interface BelongsToManyRelationMetadata extends BaseRelationMetadata {
2943
3118
  /** Optional default pivot columns */
2944
3119
  defaultPivotColumns?: string[];
2945
3120
  }
3121
+ /**
3122
+ * Metadata for morph-to (polymorphic inverse) relations.
3123
+ */
3124
+ interface MorphToRelationMetadata {
3125
+ propertyKey: string;
3126
+ kind: typeof RelationKinds.MorphTo;
3127
+ typeField: string;
3128
+ idField: string;
3129
+ targets: Record<string, EntityOrTableTargetResolver>;
3130
+ targetKey?: string;
3131
+ cascade?: CascadeMode;
3132
+ }
3133
+ /**
3134
+ * Metadata for morph-one (polymorphic one-to-one, parent side) relations.
3135
+ */
3136
+ interface MorphOneRelationMetadata {
3137
+ propertyKey: string;
3138
+ kind: typeof RelationKinds.MorphOne;
3139
+ target: EntityOrTableTargetResolver;
3140
+ morphName: string;
3141
+ typeField?: string;
3142
+ idField?: string;
3143
+ typeValue: string;
3144
+ localKey?: string;
3145
+ cascade?: CascadeMode;
3146
+ }
3147
+ /**
3148
+ * Metadata for morph-many (polymorphic one-to-many, parent side) relations.
3149
+ */
3150
+ interface MorphManyRelationMetadata {
3151
+ propertyKey: string;
3152
+ kind: typeof RelationKinds.MorphMany;
3153
+ target: EntityOrTableTargetResolver;
3154
+ morphName: string;
3155
+ typeField?: string;
3156
+ idField?: string;
3157
+ typeValue: string;
3158
+ localKey?: string;
3159
+ cascade?: CascadeMode;
3160
+ }
2946
3161
  /**
2947
3162
  * Union type for all relation metadata.
2948
3163
  */
2949
- type RelationMetadata = HasManyRelationMetadata | HasOneRelationMetadata | BelongsToRelationMetadata | BelongsToManyRelationMetadata;
3164
+ type RelationMetadata = HasManyRelationMetadata | HasOneRelationMetadata | BelongsToRelationMetadata | BelongsToManyRelationMetadata | MorphToRelationMetadata | MorphOneRelationMetadata | MorphManyRelationMetadata;
2950
3165
 
2951
3166
  /**
2952
3167
  * Entity status enum representing the lifecycle state of an entity
@@ -4017,6 +4232,9 @@ declare class RelationChangeProcessor {
4017
4232
  */
4018
4233
  private resolvePrimaryKeyValue;
4019
4234
  private buildPivotPayload;
4235
+ private handleMorphOneChange;
4236
+ private handleMorphManyChange;
4237
+ private handleMorphToChange;
4020
4238
  }
4021
4239
 
4022
4240
  /**
@@ -4191,6 +4409,9 @@ declare class OrmSession<E extends DomainEvent = OrmDomainEvent> implements Enti
4191
4409
  readonly tenantId?: string | number;
4192
4410
  private readonly interceptors;
4193
4411
  private saveGraphDefaults?;
4412
+ private transactionDepth;
4413
+ private savepointCounter;
4414
+ private rollbackOnly;
4194
4415
  /**
4195
4416
  * Creates a new OrmSession instance.
4196
4417
  * @param opts - Session options
@@ -4417,6 +4638,9 @@ declare class OrmSession<E extends DomainEvent = OrmDomainEvent> implements Enti
4417
4638
  * @returns Combined options with per-call values taking precedence
4418
4639
  */
4419
4640
  private resolveSaveGraphOptions;
4641
+ private assertSavepointSupport;
4642
+ private nextSavepointName;
4643
+ private throwIfRollbackOnly;
4420
4644
  }
4421
4645
 
4422
4646
  type WhereHasOptions = {
@@ -7048,6 +7272,7 @@ declare class TypeScriptGenerator implements ExpressionVisitor<string>, OperandV
7048
7272
  private isNamedSelection;
7049
7273
  visitBinaryExpression(binary: BinaryExpressionNode): string;
7050
7274
  visitLogicalExpression(logical: LogicalExpressionNode): string;
7275
+ visitNotExpression(notExpr: NotExpressionNode): string;
7051
7276
  visitNullExpression(nullExpr: NullExpressionNode): string;
7052
7277
  visitInExpression(inExpr: InExpressionNode): string;
7053
7278
  visitExistsExpression(existsExpr: ExistsExpressionNode): string;
@@ -7075,6 +7300,7 @@ declare class TypeScriptGenerator implements ExpressionVisitor<string>, OperandV
7075
7300
  * @returns TypeScript code representation
7076
7301
  */
7077
7302
  private printLogicalExpression;
7303
+ private printNotExpression;
7078
7304
  private printArithmeticExpression;
7079
7305
  /**
7080
7306
  * Prints an IN expression to TypeScript code
@@ -7230,7 +7456,7 @@ declare const createEntityFromRow: <TTable extends TableDef, TResult extends Ent
7230
7456
  /**
7231
7457
  * An array of database rows, each represented as a record of string keys to unknown values.
7232
7458
  */
7233
- type Rows$3 = Record<string, unknown>[];
7459
+ type Rows$4 = Record<string, unknown>[];
7234
7460
 
7235
7461
  /**
7236
7462
  * Loads related entities for a has-many relation in batch.
@@ -7240,7 +7466,7 @@ type Rows$3 = Record<string, unknown>[];
7240
7466
  * @param relation - The has-many relation definition.
7241
7467
  * @returns A promise resolving to a map of root keys to arrays of related rows.
7242
7468
  */
7243
- declare const loadHasManyRelation: (ctx: EntityContext, rootTable: TableDef, relationName: string, relation: HasManyRelation, options?: RelationIncludeOptions) => Promise<Map<string, Rows$3>>;
7469
+ declare const loadHasManyRelation: (ctx: EntityContext, rootTable: TableDef, relationName: string, relation: HasManyRelation, options?: RelationIncludeOptions) => Promise<Map<string, Rows$4>>;
7244
7470
 
7245
7471
  /**
7246
7472
  * Loads related entities for a has-one relation in batch.
@@ -7270,9 +7496,15 @@ declare const loadBelongsToRelation: (ctx: EntityContext, rootTable: TableDef, r
7270
7496
  * @param relation - The belongs-to-many relation definition.
7271
7497
  * @returns A promise resolving to a map of root keys to arrays of related rows with pivot data.
7272
7498
  */
7273
- declare const loadBelongsToManyRelation: (ctx: EntityContext, rootTable: TableDef, relationName: string, relation: BelongsToManyRelation, options?: RelationIncludeOptions) => Promise<Map<string, Rows$3>>;
7499
+ declare const loadBelongsToManyRelation: (ctx: EntityContext, rootTable: TableDef, relationName: string, relation: BelongsToManyRelation, options?: RelationIncludeOptions) => Promise<Map<string, Rows$4>>;
7500
+
7501
+ declare const loadMorphOneRelation: (ctx: EntityContext, rootTable: TableDef, relationName: string, relation: MorphOneRelation, options?: RelationIncludeOptions) => Promise<Map<string, Record<string, unknown>>>;
7502
+
7503
+ declare const loadMorphManyRelation: (ctx: EntityContext, rootTable: TableDef, relationName: string, relation: MorphManyRelation, options?: RelationIncludeOptions) => Promise<Map<string, Rows$4>>;
7274
7504
 
7275
- type Rows$2 = Record<string, unknown>[];
7505
+ declare const loadMorphToRelation: (ctx: EntityContext, rootTable: TableDef, _relationName: string, relation: MorphToRelation) => Promise<Map<string, Record<string, unknown>>>;
7506
+
7507
+ type Rows$3 = Record<string, unknown>[];
7276
7508
  /**
7277
7509
  * Default implementation of HasManyCollection for managing one-to-many relationships.
7278
7510
  * @template TChild - The type of child entities in the collection
@@ -7303,7 +7535,7 @@ declare class DefaultHasManyCollection<TChild> implements HasManyCollection<TChi
7303
7535
  * @param createEntity - Function to create entities from rows
7304
7536
  * @param localKey - The local key for the relation
7305
7537
  */
7306
- constructor(ctx: EntityContext, meta: EntityMeta<TableDef>, root: unknown, relationName: string, relation: HasManyRelation, rootTable: TableDef, loader: () => Promise<Map<string, Rows$2>>, createEntity: (row: Record<string, unknown>) => TChild, localKey: string);
7538
+ constructor(ctx: EntityContext, meta: EntityMeta<TableDef>, root: unknown, relationName: string, relation: HasManyRelation, rootTable: TableDef, loader: () => Promise<Map<string, Rows$3>>, createEntity: (row: Record<string, unknown>) => TChild, localKey: string);
7307
7539
  /**
7308
7540
  * Loads the related entities if not already loaded.
7309
7541
  * @returns Promise resolving to the array of child entities
@@ -7351,7 +7583,7 @@ declare class DefaultHasManyCollection<TChild> implements HasManyCollection<TChi
7351
7583
  toJSON(): unknown[];
7352
7584
  }
7353
7585
 
7354
- type Rows$1 = Record<string, unknown>;
7586
+ type Rows$2 = Record<string, unknown>;
7355
7587
  /**
7356
7588
  * Default implementation of a belongs-to reference.
7357
7589
  * Manages a reference to a parent entity from a child entity through a foreign key.
@@ -7381,7 +7613,7 @@ declare class DefaultBelongsToReference<TParent extends object> implements Belon
7381
7613
  * @param createEntity Function to create entity instances from rows.
7382
7614
  * @param targetKey The primary key of the target (parent) table.
7383
7615
  */
7384
- constructor(ctx: EntityContext, meta: EntityMeta<TableDef>, root: unknown, relationName: string, relation: BelongsToRelation, rootTable: TableDef, loader: () => Promise<Map<string, Rows$1>>, createEntity: (row: Record<string, unknown>) => TParent, targetKey: string);
7616
+ constructor(ctx: EntityContext, meta: EntityMeta<TableDef>, root: unknown, relationName: string, relation: BelongsToRelation, rootTable: TableDef, loader: () => Promise<Map<string, Rows$2>>, createEntity: (row: Record<string, unknown>) => TParent, targetKey: string);
7385
7617
  load(): Promise<TParent | null>;
7386
7618
  get(): TParent | null;
7387
7619
  set(data: Partial<TParent> | TParent | null): TParent | null;
@@ -7390,7 +7622,7 @@ declare class DefaultBelongsToReference<TParent extends object> implements Belon
7390
7622
  toJSON(): unknown;
7391
7623
  }
7392
7624
 
7393
- type Rows = Record<string, unknown>[];
7625
+ type Rows$1 = Record<string, unknown>[];
7394
7626
  /**
7395
7627
  * Default implementation of a many-to-many collection.
7396
7628
  * Manages the relationship between two entities through a pivot table.
@@ -7421,7 +7653,7 @@ declare class DefaultManyToManyCollection<TTarget, TPivot extends object | undef
7421
7653
  * @param createEntity Function to create entity instances from rows.
7422
7654
  * @param localKey The local key used for joining.
7423
7655
  */
7424
- constructor(ctx: EntityContext, meta: EntityMeta<TableDef>, root: unknown, relationName: string, relation: BelongsToManyRelation, rootTable: TableDef, loader: () => Promise<Map<string, Rows>>, createEntity: (row: Record<string, unknown>) => TTarget, localKey: string);
7656
+ constructor(ctx: EntityContext, meta: EntityMeta<TableDef>, root: unknown, relationName: string, relation: BelongsToManyRelation, rootTable: TableDef, loader: () => Promise<Map<string, Rows$1>>, createEntity: (row: Record<string, unknown>) => TTarget, localKey: string);
7425
7657
  /**
7426
7658
  * Loads the collection items if not already loaded.
7427
7659
  * @returns A promise that resolves to the array of target entities.
@@ -7467,6 +7699,82 @@ declare class DefaultManyToManyCollection<TTarget, TPivot extends object | undef
7467
7699
  toJSON(): unknown[];
7468
7700
  }
7469
7701
 
7702
+ type Row$1 = Record<string, unknown>;
7703
+ declare class DefaultMorphOneReference<TChild extends object> implements HasOneReferenceApi<TChild> {
7704
+ private readonly ctx;
7705
+ private readonly meta;
7706
+ private readonly root;
7707
+ private readonly relationName;
7708
+ private readonly relation;
7709
+ private readonly rootTable;
7710
+ private readonly loader;
7711
+ private readonly createEntity;
7712
+ private readonly localKey;
7713
+ private loaded;
7714
+ private current;
7715
+ constructor(ctx: EntityContext, meta: EntityMeta<TableDef>, root: unknown, relationName: string, relation: MorphOneRelation, rootTable: TableDef, loader: () => Promise<Map<string, Row$1>>, createEntity: (row: Row$1) => TChild, localKey: string);
7716
+ load(): Promise<TChild | null>;
7717
+ get(): TChild | null;
7718
+ set(data: Partial<TChild> | TChild | null): TChild | null;
7719
+ toJSON(): unknown;
7720
+ private detachCurrent;
7721
+ private assignMorphKeys;
7722
+ private get relationKey();
7723
+ private populateFromHydrationCache;
7724
+ }
7725
+
7726
+ type Rows = Record<string, unknown>[];
7727
+ declare class DefaultMorphManyCollection<TChild> implements HasManyCollection<TChild> {
7728
+ private readonly ctx;
7729
+ private readonly meta;
7730
+ private readonly root;
7731
+ private readonly relationName;
7732
+ private readonly relation;
7733
+ private readonly rootTable;
7734
+ private readonly loader;
7735
+ private readonly createEntity;
7736
+ private readonly localKey;
7737
+ private loaded;
7738
+ private items;
7739
+ private readonly added;
7740
+ private readonly removed;
7741
+ constructor(ctx: EntityContext, meta: EntityMeta<TableDef>, root: unknown, relationName: string, relation: MorphManyRelation, rootTable: TableDef, loader: () => Promise<Map<string, Rows>>, createEntity: (row: Record<string, unknown>) => TChild, localKey: string);
7742
+ load(): Promise<TChild[]>;
7743
+ getItems(): TChild[];
7744
+ get length(): number;
7745
+ [Symbol.iterator](): Iterator<TChild>;
7746
+ add(data: Partial<TChild>): TChild;
7747
+ attach(entity: TChild): void;
7748
+ remove(entity: TChild): void;
7749
+ clear(): void;
7750
+ private get relationKey();
7751
+ private hydrateFromCache;
7752
+ toJSON(): unknown[];
7753
+ }
7754
+
7755
+ type Row = Record<string, unknown>;
7756
+ declare class DefaultMorphToReference<TParent extends object> implements BelongsToReferenceApi<TParent> {
7757
+ private readonly ctx;
7758
+ private readonly meta;
7759
+ private readonly root;
7760
+ private readonly relationName;
7761
+ private readonly relation;
7762
+ private readonly rootTable;
7763
+ private readonly loader;
7764
+ private readonly createEntity;
7765
+ private readonly resolveTargetTable;
7766
+ private loaded;
7767
+ private current;
7768
+ constructor(ctx: EntityContext, meta: EntityMeta<TableDef>, root: unknown, relationName: string, relation: MorphToRelation, rootTable: TableDef, loader: () => Promise<Map<string, Row>>, createEntity: (table: TableDef, row: Row) => TParent, resolveTargetTable: (typeValue: string) => TableDef | undefined);
7769
+ load(): Promise<TParent | null>;
7770
+ get(): TParent | null;
7771
+ set(data: Partial<TParent> | TParent | null): TParent | null;
7772
+ toJSON(): unknown;
7773
+ private detachCurrent;
7774
+ private get relationKey();
7775
+ private populateFromHydrationCache;
7776
+ }
7777
+
7470
7778
  /**
7471
7779
  * Executes a hydrated query using the ORM session.
7472
7780
  * @template TTable - The table type
@@ -7530,7 +7838,7 @@ interface EntityOptions {
7530
7838
  * @param options - Configuration options for the entity.
7531
7839
  * @returns A class decorator that registers the entity metadata.
7532
7840
  */
7533
- declare function Entity(options?: EntityOptions): <T extends EntityConstructor>(value: T, context: ClassDecoratorContext) => T;
7841
+ declare function Entity(options?: EntityOptions): <T extends EntityConstructor>(value: T, context?: ClassDecoratorContext) => T;
7534
7842
 
7535
7843
  /**
7536
7844
  * Options for defining a column in an entity.
@@ -7553,14 +7861,14 @@ type ColumnInput = ColumnOptions | ColumnDef;
7553
7861
  * @param definition - The column definition or options.
7554
7862
  * @returns A property decorator that registers the column metadata.
7555
7863
  */
7556
- declare function Column(definition: ColumnInput): (_value: unknown, context: ClassFieldDecoratorContext) => void;
7864
+ declare function Column(definition: ColumnInput): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7557
7865
  /**
7558
7866
  * Decorator to define a primary key column on an entity property.
7559
7867
  * Sets the primary flag to true and delegates to Column decorator.
7560
7868
  * @param definition - The column definition or options.
7561
7869
  * @returns A property decorator that registers the primary key column metadata.
7562
7870
  */
7563
- declare function PrimaryKey(definition: ColumnInput): (_value: unknown, context: ClassFieldDecoratorContext) => void;
7871
+ declare function PrimaryKey(definition: ColumnInput): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7564
7872
 
7565
7873
  interface BaseRelationOptions {
7566
7874
  target: EntityOrTableTargetResolver;
@@ -7604,25 +7912,77 @@ interface BelongsToManyOptions<TTarget extends EntityOrTableTarget = EntityOrTab
7604
7912
  * @param options - The relation options.
7605
7913
  * @returns A property decorator that registers the relation metadata.
7606
7914
  */
7607
- declare function HasMany(options: HasManyOptions): (_value: unknown, context: ClassFieldDecoratorContext) => void;
7915
+ declare function HasMany(options: HasManyOptions): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7608
7916
  /**
7609
7917
  * Decorator to define a HasOne relation on an entity property.
7610
7918
  * @param options - The relation options.
7611
7919
  * @returns A property decorator that registers the relation metadata.
7612
7920
  */
7613
- declare function HasOne(options: HasOneOptions): (_value: unknown, context: ClassFieldDecoratorContext) => void;
7921
+ declare function HasOne(options: HasOneOptions): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7614
7922
  /**
7615
7923
  * Decorator to define a BelongsTo relation on an entity property.
7616
7924
  * @param options - The relation options.
7617
7925
  * @returns A property decorator that registers the relation metadata.
7618
7926
  */
7619
- declare function BelongsTo(options: BelongsToOptions): (_value: unknown, context: ClassFieldDecoratorContext) => void;
7927
+ declare function BelongsTo(options: BelongsToOptions): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7620
7928
  /**
7621
7929
  * Decorator to define a BelongsToMany relation on an entity property.
7622
7930
  * @param options - The relation options.
7623
7931
  * @returns A property decorator that registers the relation metadata.
7624
7932
  */
7625
- declare function BelongsToMany<TTarget extends EntityOrTableTarget = EntityOrTableTarget, TPivot extends EntityOrTableTarget = EntityOrTableTarget>(options: BelongsToManyOptions<TTarget, TPivot>): (_value: unknown, context: ClassFieldDecoratorContext) => void;
7933
+ declare function BelongsToMany<TTarget extends EntityOrTableTarget = EntityOrTableTarget, TPivot extends EntityOrTableTarget = EntityOrTableTarget>(options: BelongsToManyOptions<TTarget, TPivot>): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7934
+ /**
7935
+ * Options for MorphTo relation.
7936
+ */
7937
+ interface MorphToOptions {
7938
+ typeField: string;
7939
+ idField: string;
7940
+ targets: Record<string, EntityOrTableTargetResolver>;
7941
+ targetKey?: string;
7942
+ cascade?: CascadeMode;
7943
+ }
7944
+ /**
7945
+ * Options for MorphOne relation.
7946
+ */
7947
+ interface MorphOneOptions {
7948
+ target: EntityOrTableTargetResolver;
7949
+ morphName: string;
7950
+ typeValue: string;
7951
+ typeField?: string;
7952
+ idField?: string;
7953
+ localKey?: string;
7954
+ cascade?: CascadeMode;
7955
+ }
7956
+ /**
7957
+ * Options for MorphMany relation.
7958
+ */
7959
+ interface MorphManyOptions {
7960
+ target: EntityOrTableTargetResolver;
7961
+ morphName: string;
7962
+ typeValue: string;
7963
+ typeField?: string;
7964
+ idField?: string;
7965
+ localKey?: string;
7966
+ cascade?: CascadeMode;
7967
+ }
7968
+ /**
7969
+ * Decorator to define a MorphTo relation on an entity property.
7970
+ * @param options - The relation options.
7971
+ * @returns A property decorator that registers the relation metadata.
7972
+ */
7973
+ declare function MorphTo(options: MorphToOptions): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7974
+ /**
7975
+ * Decorator to define a MorphOne relation on an entity property.
7976
+ * @param options - The relation options.
7977
+ * @returns A property decorator that registers the relation metadata.
7978
+ */
7979
+ declare function MorphOne(options: MorphOneOptions): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7980
+ /**
7981
+ * Decorator to define a MorphMany relation on an entity property.
7982
+ * @param options - The relation options.
7983
+ * @returns A property decorator that registers the relation metadata.
7984
+ */
7985
+ declare function MorphMany(options: MorphManyOptions): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7626
7986
 
7627
7987
  /**
7628
7988
  * Bootstraps all entities by building their table definitions and relations.
@@ -7730,31 +8090,31 @@ declare function Trim(options?: {
7730
8090
  trimStart?: boolean;
7731
8091
  trimEnd?: boolean;
7732
8092
  trimAll?: boolean;
7733
- }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
7734
- declare function Lower(): (_value: unknown, context: ClassFieldDecoratorContext) => void;
7735
- declare function Upper(): (_value: unknown, context: ClassFieldDecoratorContext) => void;
7736
- declare function Capitalize(): (_value: unknown, context: ClassFieldDecoratorContext) => void;
7737
- declare function Title(): (_value: unknown, context: ClassFieldDecoratorContext) => void;
8093
+ }): (targetOrValue: unknown, contextOrProperty: unknown) => void;
8094
+ declare function Lower(): (targetOrValue: unknown, contextOrProperty: unknown) => void;
8095
+ declare function Upper(): (targetOrValue: unknown, contextOrProperty: unknown) => void;
8096
+ declare function Capitalize(): (targetOrValue: unknown, contextOrProperty: unknown) => void;
8097
+ declare function Title(): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7738
8098
  declare function Alphanumeric(options?: {
7739
8099
  allowSpaces?: boolean;
7740
8100
  allowUnderscores?: boolean;
7741
8101
  allowHyphens?: boolean;
7742
- }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
8102
+ }): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7743
8103
  declare function Email(options?: {
7744
8104
  allowPlus?: boolean;
7745
8105
  requireTLD?: boolean;
7746
- }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
8106
+ }): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7747
8107
  declare function Length(options: {
7748
8108
  min?: number;
7749
8109
  max?: number;
7750
8110
  exact?: number;
7751
- }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
8111
+ }): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7752
8112
  declare function Pattern(options: {
7753
8113
  pattern: RegExp;
7754
8114
  flags?: string;
7755
8115
  errorMessage?: string;
7756
8116
  replacement?: string;
7757
- }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
8117
+ }): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7758
8118
 
7759
8119
  /**
7760
8120
  * Decorator to validate a Brazilian CPF number
@@ -7764,7 +8124,7 @@ declare function Pattern(options: {
7764
8124
  declare function CPF(options?: {
7765
8125
  strict?: boolean;
7766
8126
  errorMessage?: string;
7767
- }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
8127
+ }): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7768
8128
  /**
7769
8129
  * Decorator to validate a Brazilian CNPJ number
7770
8130
  * @param options - Validation options
@@ -7773,7 +8133,7 @@ declare function CPF(options?: {
7773
8133
  declare function CNPJ(options?: {
7774
8134
  strict?: boolean;
7775
8135
  errorMessage?: string;
7776
- }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
8136
+ }): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7777
8137
  /**
7778
8138
  * Decorator to validate a Brazilian CEP number
7779
8139
  * @param options - Validation options
@@ -7782,7 +8142,7 @@ declare function CNPJ(options?: {
7782
8142
  declare function CEP(options?: {
7783
8143
  strict?: boolean;
7784
8144
  errorMessage?: string;
7785
- }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
8145
+ }): (targetOrValue: unknown, contextOrProperty: unknown) => void;
7786
8146
 
7787
8147
  /**
7788
8148
  * Base interface for country-specific identifier validators
@@ -8057,6 +8417,9 @@ interface SqliteClientLike {
8057
8417
  beginTransaction?(): Promise<void>;
8058
8418
  commitTransaction?(): Promise<void>;
8059
8419
  rollbackTransaction?(): Promise<void>;
8420
+ savepoint?(name: string): Promise<void>;
8421
+ releaseSavepoint?(name: string): Promise<void>;
8422
+ rollbackToSavepoint?(name: string): Promise<void>;
8060
8423
  }
8061
8424
  /**
8062
8425
  * Creates a database executor for SQLite.
@@ -8065,6 +8428,25 @@ interface SqliteClientLike {
8065
8428
  */
8066
8429
  declare function createSqliteExecutor(client: SqliteClientLike): DbExecutor;
8067
8430
 
8431
+ interface BetterSqlite3Statement {
8432
+ reader: boolean;
8433
+ all(...params: unknown[]): unknown[];
8434
+ run(...params: unknown[]): {
8435
+ changes: number;
8436
+ lastInsertRowid: number | bigint;
8437
+ };
8438
+ }
8439
+ interface BetterSqlite3ClientLike {
8440
+ prepare(sql: string): BetterSqlite3Statement;
8441
+ transaction<T extends (...args: any[]) => any>(fn: T): T;
8442
+ }
8443
+ /**
8444
+ * Creates a database executor for better-sqlite3.
8445
+ * @param client A better-sqlite3 database instance.
8446
+ * @returns A DbExecutor implementation for better-sqlite3.
8447
+ */
8448
+ declare function createBetterSqlite3Executor(client: BetterSqlite3ClientLike): DbExecutor;
8449
+
8068
8450
  interface MssqlClientLike {
8069
8451
  query(sql: string, params?: unknown[]): Promise<{
8070
8452
  recordset?: Array<Record<string, unknown>>;
@@ -8123,6 +8505,9 @@ interface PooledConnectionAdapter<TConn> {
8123
8505
  beginTransaction(conn: TConn): Promise<void>;
8124
8506
  commitTransaction(conn: TConn): Promise<void>;
8125
8507
  rollbackTransaction(conn: TConn): Promise<void>;
8508
+ savepoint?(conn: TConn, name: string): Promise<void>;
8509
+ releaseSavepoint?(conn: TConn, name: string): Promise<void>;
8510
+ rollbackToSavepoint?(conn: TConn, name: string): Promise<void>;
8126
8511
  }
8127
8512
  type PooledExecutorFactoryOptions<TConn> = {
8128
8513
  pool: Pool<TConn>;
@@ -8435,7 +8820,9 @@ type FilterValue = StringFilter | NumberFilter | BooleanFilter | DateFilter;
8435
8820
  interface ApplyFilterOptions<TTable extends TableDef> {
8436
8821
  relations?: {
8437
8822
  [K in keyof TTable['relations']]?: boolean | {
8438
- relations?: ApplyFilterOptions<TTable['relations'][K]['target']>['relations'];
8823
+ relations?: TTable['relations'][K] extends {
8824
+ target: infer TTarget extends TableDef;
8825
+ } ? ApplyFilterOptions<TTarget>['relations'] : never;
8439
8826
  };
8440
8827
  };
8441
8828
  }
@@ -9793,7 +10180,7 @@ interface TreeDecoratorOptions {
9793
10180
  * }
9794
10181
  * ```
9795
10182
  */
9796
- declare function Tree(options?: TreeDecoratorOptions): <T extends abstract new (...args: unknown[]) => object>(target: T, context: ClassDecoratorContext<T>) => T;
10183
+ declare function Tree(options?: TreeDecoratorOptions): <T extends abstract new (...args: unknown[]) => object>(target: T, context?: ClassDecoratorContext<T>) => T;
9797
10184
  /**
9798
10185
  * Decorator to mark a property as the parent relation in a tree entity.
9799
10186
  *
@@ -9803,7 +10190,7 @@ declare function Tree(options?: TreeDecoratorOptions): <T extends abstract new (
9803
10190
  * parent?: Category;
9804
10191
  * ```
9805
10192
  */
9806
- declare function TreeParent(): <T, V>(_value: undefined, context: ClassFieldDecoratorContext<T, V>) => void;
10193
+ declare function TreeParent(): (targetOrValue: unknown, contextOrProperty: unknown) => void;
9807
10194
  /**
9808
10195
  * Decorator to mark a property as the children relation in a tree entity.
9809
10196
  *
@@ -9813,7 +10200,7 @@ declare function TreeParent(): <T, V>(_value: undefined, context: ClassFieldDeco
9813
10200
  * children?: Category[];
9814
10201
  * ```
9815
10202
  */
9816
- declare function TreeChildren(): <T, V>(_value: undefined, context: ClassFieldDecoratorContext<T, V>) => void;
10203
+ declare function TreeChildren(): (targetOrValue: unknown, contextOrProperty: unknown) => void;
9817
10204
  /**
9818
10205
  * Synchronizes tree metadata + self-relations for entities using @Tree decorators.
9819
10206
  * Safe to call multiple times (idempotent).
@@ -9895,4 +10282,137 @@ declare function setTreeBounds(entity: object, config: TreeConfig, lft: number,
9895
10282
  */
9896
10283
  declare function setTreeParentId(entity: object, config: TreeConfig, parentId: unknown): void;
9897
10284
 
9898
- export { type AliasRefNode, Alphanumeric, type AnyDomainEvent, type ApiRouteDefinition, type ApplyFilterOptions, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, type AutoCorrectionResult, type AutoTransformResult, type AutoTransformableValidator, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToReferenceApi, type BelongsToRelation, type BetweenExpressionNode, BigIntTypeStrategy, type BinaryExpressionNode, BinaryTypeStrategy, type BitwiseExpressionNode, type BooleanFilter, BooleanTypeStrategy, CEP, CNPJ, CPF, type CacheCapabilities, type CacheInvalidator, type CacheOptions, type CacheProvider, type CacheReader, type CacheState, type CacheStrategy, type CacheWriter, type CallProcedureOptions, Capitalize, type CascadeMode, type CaseExpressionNode, type CastExpressionNode, type CheckConstraint, type CollateExpressionNode, Column, type ColumnDef, type ColumnDiff, type ColumnInput, type ColumnNode, type ColumnOptions, type ColumnRef, type ColumnToTs, type ColumnType, type ComponentOptions, type ComponentReference, type CompositeTransformer, ConflictBuilder, ConstructorMaterializationStrategy, type ValidationResult as CountryValidationResult, type CountryValidator, type CountryValidatorFactory, type CreateDto, type CreateTediousClientOptions, type CursorPageInfo, type CursorPageOptions, type CursorPageResult, DEFAULT_TREE_CONFIG, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DatabaseView, type DateFilter, DateTimeTypeStrategy, type DbExecutor, type DbExecutorFactory, DecimalTypeStrategy, type DecoratedEntityInstance, DefaultBelongsToReference, DefaultCacheStrategy, DefaultEntityMaterializer, DefaultHasManyCollection, DefaultManyToManyCollection, DefaultTypeStrategy, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, type Dto, type Duration, Email, Entity, type EntityContext, type EntityInstance, type EntityMaterializationStrategy, type EntityMaterializer, type EntityOptions, type PrimaryKey$1 as EntityPrimaryKey, EntityStatus, type ExecuteFilteredPagedOptions, type ExecutionContext, type ExecutionPayload, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type FieldFilter, type FilterOperator, type FilterValue, type FindChildrenOptions, type FindPathOptions, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, type HasOneReferenceApi, type HasOneRelation, type HydrationContext, type HydrationMetadata, type HydrationPivotPlan, type HydrationPlan, type HydrationRelationPlan, type InExpressionNode, type InExpressionRight, type IndexColumn, type IndexDef, type InferRow, type InitialHandlers, InsertQueryBuilder, IntegerTypeStrategy, InterceptorPipeline, type IntrospectOptions, type InvalidationStrategy, type JsonArray, type JsonObject, type JsonPathNode, type JsonValue, type Jsonify, type JsonifyScalar, KeyvCacheAdapter, Length, type LiteralNode, type LiteralValue, type LogicalExpressionNode, Lower, type ManyToManyCollection, MemoryCacheAdapter, type MoveOptions, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NestedDtoOptions, type NestedSetBounds, type NestedSetRow, NestedSetStrategy, type NodeWithPk, type NullExpressionNode, type NumberFilter, type OpenApiComponent, type OpenApiDialect, type OpenApiDocument, type OpenApiDocumentInfo, type OpenApiDocumentOptions, type OpenApiOperation, type OpenApiParameter, type OpenApiParameterObject, type OpenApiResponseObject, type OpenApiSchema, type OpenApiType, type OperandNode, type OperandVisitor, Orm, type OrmCacheOptions, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, type PagedResponse, type PaginatedResult, type PaginationParams, type PatchGraphInputPayload, Pattern, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type Primitive, ProcedureCallBuilder, type ProcedureCallNode, type ProcedureDirection, type ProcedureExecutionResult, type ProcedureOutOptions, type ProcedureParamNode, type ProcedureRefNode, type PropertySanitizer, type PropertyTransformer, type PropertyValidator, PrototypeMaterializationStrategy, QueryCacheManager, type QueryContext, type QueryInterceptor, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type RecoverResult, RedisCacheAdapter, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationFilter, type RelationKey$1 as RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type SaveGraphSessionOptions, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SelectableKeys, type SimpleQueryRunner, type SimpleWhereInput, type Simplify, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type StringFilter, StringTypeStrategy, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, TagIndex, type TargetType, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, type ThreadedNode, Title, type ToJsonOptions, type TrackedEntity, type TransformContext, type TransformerConfig, type TransformerMetadata, Tree, TreeChildren, type TreeColumns, type TreeConfig, type TreeDecoratorOptions, type TreeInsertData, type TreeListEntry, type TreeListOptions, type TreeListSchemaOptions, TreeManager, type TreeManagerOptions, type TreeMetadata, type TreeMoveData, type TreeNode, type TreeNodeResult, type TreeNodeResultSchemaOptions, type TreeNodeSchemaOptions, TreeParent, type TreeQuery, type TreeScope, type TreeValidationResult, Trim, TypeMappingService, type TypeMappingStrategy, TypeScriptGenerator, type TypedExpression, type TypedLike, type UpdateDto, UpdateQueryBuilder, Upper, UuidTypeStrategy, type ValidationOptions, type ValidationResult$1 as ValidationResult, type ValidatorFactoryOptions, type ValueOperandInput, type WhereInput, type WindowFunctionNode, type WithRelations, abs, acos, add, addDomainEvent, addEntityRelation, addRelation, age, aliasRef, and, applyFilter, applyNullability, arrayAppend, asType, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bitAnd, bitLength, bitOr, bitXor, bootstrapEntities, buildFilterExpression, buildScopeConditions, calculateRowDepths, calculateTotalPages, callProcedure, canonicalizeSchema, caseWhen, cast, cbrt, ceil, ceiling, char, charLength, chr, clearExpressionDispatchers, clearOperandDispatchers, coalesce, col, collate, columnOperand, columnToFilterSchema, columnToOpenApiSchema, columnTypeToOpenApiFormat, columnTypeToOpenApiType, computePaginationMetadata, computeSchemaHash, concat, concatWs, correlateBy, cos, cot, count, countAll, createApiComponentsSection, createDeterministicNamingState, createDtoToOpenApiSchema, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createRef, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, createTreeManager, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, deepCloneSchema, defineTable, degrees, deleteFrom, denseRank, diffSchema, div, dtoToOpenApiSchema, endOfMonth, entityRef, entityRefs, eq, esel, exclude, executeFilteredPaged, executeHydrated, executeHydratedPlain, executeHydratedPlainWithContexts, executeHydratedWithContexts, executeProcedureAst, executeSchemaSql, executeSchemaSqlFor, exists, exp, extract, extractReusableSchemas, extractScopeValues, firstValue, floor, formatDuration, formatTreeList, fromUnixTime, generateComponentSchemas, generateCreateTableSql, generateOpenApiDocument, generateRelationComponents, generateSchemaSql, generateSchemaSqlFor, generateTreeComponents, getColumn, getColumnMap, getColumnType, getDateKind, getDecoratorMetadata, getDeterministicComponentName, getOpenApiVersionForDialect, getRegisteredValidators, getSchemaIntrospector, getTableDefFromEntity, getTreeBounds, getTreeColumns, getTreeConfig, getTreeMetadata, getTreeParentId, greatest, groupConcat, gt, gte, hasMany, hasNextPage as hasNextPageMeta, hasOne, hasPrevPage as hasPrevPageMeta, hasTreeBehavior, hasValidator, hour, hydrateRows, ifNull, inList, inSubquery, initcap, insertInto, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isCollateExpressionNode, isComponentReference, isExpressionSelectionNode, isFunctionNode, isNotNull, isNull, isNullableColumn, isOperandNode, isTableDef, isTreeConfig, isValidDuration, isValueOperandInput, isWindowFunctionNode, jsonArrayAgg, jsonContains, jsonLength, jsonPath, jsonSet, jsonify, lag, lastValue, lead, least, left, length, like, ln, loadBelongsToManyRelation, loadBelongsToRelation, loadHasManyRelation, loadHasOneRelation, localTime, localTimestamp, locate, log, log10, log2, logBase, lower, lpad, lt, lte, ltrim, mapFields, materializeAs, max, md5, mergeSchemas, min, minute, mod, month, mul, neq, nestedDtoToOpenApiSchema, nestedWhereInputToOpenApiSchema, normalizeColumnType, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, nullif, octetLength, or, outerRef, pagedResponseToOpenApiSchema, paginationParamsSchema, parameterToRef, parseDuration, payloadResultSets, pi, pick, position, pow, power, quarter, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, registerValidator, relationFilterToOpenApiSchema, relationLoaderCache, renderColumnDefinition, renderTypeWithArgs, repeat, replace, replaceWithRefs, resolveTreeConfig, resolveValidator, responseToRef, reverse, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, schemaToJson, schemaToRef, second, sel, selectFrom, selectFromEntity, setRelations, setTreeBounds, setTreeMetadata, setTreeParentId, sha1, sha2, shiftLeft, shiftRight, sign, sin, space, sqrt, stddev, sub, substr, sum, syncTreeEntityMetadata, synchronizeSchema, tableRef, tan, threadResults, threadedNodeToOpenApiSchema, toColumnRef, toExecutionPayload, toPagedResponse, toPagedResponseBuilder, toPaginationParams, toResponse, toResponseBuilder, toTableRef, treeEntityRegistry, treeListEntryToOpenApiSchema, treeNodeResultToOpenApiSchema, treeNodeToOpenApiSchema, treeQuery, trim, trunc, truncate, typeMappingService, unixTimestamp, update, updateDtoToOpenApiSchema, updateDtoWithRelationsToOpenApiSchema, upper, utcNow, validateTreeTable, valueToOperand, variance, visitExpression, visitOperand, weekOfYear, whereInputToOpenApiSchema, whereInputWithRelationsToOpenApiSchema, windowFunction, withDefaults, withDefaultsBuilder, year };
10285
+ type BulkConcurrency = 'sequential' | number;
10286
+ interface BulkResult {
10287
+ processedRows: number;
10288
+ chunksExecuted: number;
10289
+ returning: Record<string, unknown>[];
10290
+ chunkTimings?: number[];
10291
+ metadata?: BulkResultMetadata;
10292
+ }
10293
+ interface BulkResultMetadata {
10294
+ strategy: 'individual' | 'batch' | 'whereIn';
10295
+ dialect: string;
10296
+ hasReturningSupport: boolean;
10297
+ }
10298
+ interface BulkBaseOptions {
10299
+ chunkSize?: number;
10300
+ concurrency?: BulkConcurrency;
10301
+ transactional?: boolean;
10302
+ timing?: boolean;
10303
+ onChunkComplete?: (info: ChunkCompleteInfo) => void | Promise<void>;
10304
+ }
10305
+ interface ChunkCompleteInfo {
10306
+ chunkIndex: number;
10307
+ totalChunks: number;
10308
+ rowsInChunk: number;
10309
+ elapsedMs: number;
10310
+ }
10311
+ type InsertRow = Record<string, ValueOperandInput>;
10312
+ interface BulkInsertOptions extends BulkBaseOptions {
10313
+ returning?: boolean | ColumnDef[];
10314
+ onConflict?: UpsertClause;
10315
+ }
10316
+ interface BulkUpsertOptions extends BulkInsertOptions {
10317
+ conflictColumns?: string[];
10318
+ updateColumns?: string[];
10319
+ }
10320
+ type UpdateRow = Record<string, ValueOperandInput>;
10321
+ interface BulkUpdateOptions extends BulkBaseOptions {
10322
+ by?: string | string[];
10323
+ where?: ExpressionNode;
10324
+ returning?: boolean | ColumnDef[];
10325
+ }
10326
+ interface BulkDeleteOptions extends BulkBaseOptions {
10327
+ by?: string;
10328
+ where?: ExpressionNode;
10329
+ }
10330
+ interface ChunkOutcome {
10331
+ processedRows: number;
10332
+ returning: Record<string, unknown>[];
10333
+ elapsedMs: number;
10334
+ }
10335
+
10336
+ interface BulkExecutionContext {
10337
+ readonly session: OrmSession;
10338
+ readonly executionContext: ExecutionContext;
10339
+ readonly dialect: Dialect;
10340
+ readonly supportsReturning: boolean;
10341
+ }
10342
+
10343
+ interface BulkExecutorOptions extends BulkBaseOptions {
10344
+ chunkSize?: number;
10345
+ concurrency?: 'sequential' | number;
10346
+ transactional?: boolean;
10347
+ timing?: boolean;
10348
+ onChunkComplete?: (info: {
10349
+ chunkIndex: number;
10350
+ totalChunks: number;
10351
+ rowsInChunk: number;
10352
+ elapsedMs: number;
10353
+ }) => void | Promise<void>;
10354
+ }
10355
+ declare abstract class BulkBaseExecutor<TOptions extends BulkExecutorOptions> {
10356
+ protected readonly session: OrmSession;
10357
+ protected readonly table: TableDef;
10358
+ protected readonly ctx: BulkExecutionContext;
10359
+ protected readonly options: TOptions;
10360
+ protected readonly chunks: unknown[][];
10361
+ protected readonly totalChunks: number;
10362
+ constructor(session: OrmSession, table: TableDef, rows: unknown[], options?: TOptions);
10363
+ protected abstract executeChunk(chunk: unknown[], chunkIndex: number): Promise<ChunkOutcome>;
10364
+ execute(): Promise<BulkResult>;
10365
+ }
10366
+
10367
+ interface InsertExecutorOptions extends BulkExecutorOptions {
10368
+ returning?: boolean | ColumnDef[];
10369
+ onConflict?: UpsertClause;
10370
+ }
10371
+ declare class BulkInsertExecutor extends BulkBaseExecutor<InsertExecutorOptions> {
10372
+ constructor(session: OrmSession, table: TableDef, rows: InsertRow[], options?: BulkInsertOptions);
10373
+ protected executeChunk(chunk: InsertRow[], chunkIndex: number): Promise<ChunkOutcome>;
10374
+ }
10375
+ declare function bulkInsert<TTable extends TableDef>(session: OrmSession, table: TTable, rows: InsertRow[], options?: BulkInsertOptions): Promise<BulkResult>;
10376
+
10377
+ interface UpdateExecutorOptions extends BulkExecutorOptions {
10378
+ by?: string | string[];
10379
+ where?: ExpressionNode;
10380
+ returning?: boolean | ColumnDef[];
10381
+ }
10382
+ declare class BulkUpdateExecutor extends BulkBaseExecutor<UpdateExecutorOptions> {
10383
+ private readonly byColumns;
10384
+ constructor(session: OrmSession, table: TableDef, rows: UpdateRow[], options?: BulkUpdateOptions);
10385
+ protected executeChunk(chunk: UpdateRow[], chunkIndex: number): Promise<ChunkOutcome>;
10386
+ }
10387
+ declare function bulkUpdate<TTable extends TableDef>(session: OrmSession, table: TTable, rows: UpdateRow[], options?: BulkUpdateOptions): Promise<BulkResult>;
10388
+ declare function bulkUpdateWhere<TTable extends TableDef>(session: OrmSession, table: TTable, ids: ValueOperandInput[], set: Record<string, ValueOperandInput>, options?: Omit<BulkUpdateOptions, 'by' | 'returning'> & {
10389
+ by?: string;
10390
+ returning?: boolean | ColumnDef[];
10391
+ }): Promise<BulkResult>;
10392
+
10393
+ interface DeleteExecutorOptions extends BulkExecutorOptions {
10394
+ by?: string;
10395
+ where?: ExpressionNode;
10396
+ }
10397
+ declare class BulkDeleteExecutor extends BulkBaseExecutor<DeleteExecutorOptions> {
10398
+ private readonly byColumnName;
10399
+ constructor(session: OrmSession, table: TableDef, ids: ValueOperandInput[], options?: BulkDeleteOptions);
10400
+ protected executeChunk(chunk: ValueOperandInput[], chunkIndex: number): Promise<ChunkOutcome>;
10401
+ }
10402
+ declare function bulkDelete<TTable extends TableDef>(session: OrmSession, table: TTable, ids: ValueOperandInput[], options?: BulkDeleteOptions): Promise<BulkResult>;
10403
+ declare function bulkDeleteWhere<TTable extends TableDef>(session: OrmSession, table: TTable, where: ExpressionNode, options?: Pick<BulkDeleteOptions, 'transactional'>): Promise<BulkResult>;
10404
+
10405
+ interface UpsertExecutorOptions extends BulkExecutorOptions {
10406
+ conflictColumns?: string[];
10407
+ updateColumns?: string[];
10408
+ returning?: boolean | ColumnDef[];
10409
+ }
10410
+ declare class BulkUpsertExecutor extends BulkBaseExecutor<UpsertExecutorOptions> {
10411
+ private readonly conflictTargetNodes;
10412
+ private readonly updateColumns;
10413
+ constructor(session: OrmSession, table: TableDef, rows: InsertRow[], options?: BulkUpsertOptions);
10414
+ protected executeChunk(chunk: InsertRow[], chunkIndex: number): Promise<ChunkOutcome>;
10415
+ }
10416
+ declare function bulkUpsert<TTable extends TableDef>(session: OrmSession, table: TTable, rows: InsertRow[], options?: BulkUpsertOptions): Promise<BulkResult>;
10417
+
10418
+ export { type AliasRefNode, Alphanumeric, type AnyDomainEvent, type ApiRouteDefinition, type ApplyFilterOptions, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, type AutoCorrectionResult, type AutoTransformResult, type AutoTransformableValidator, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToReferenceApi, type BelongsToRelation, type BetterSqlite3ClientLike, type BetterSqlite3Statement, type BetweenExpressionNode, BigIntTypeStrategy, type BinaryExpressionNode, BinaryTypeStrategy, type BitwiseExpressionNode, type BooleanFilter, BooleanTypeStrategy, type BulkBaseOptions, type BulkConcurrency, BulkDeleteExecutor, type BulkDeleteOptions, BulkInsertExecutor, type BulkInsertOptions, type BulkResult, BulkUpdateExecutor, type BulkUpdateOptions, BulkUpsertExecutor, type BulkUpsertOptions, CEP, CNPJ, CPF, type CacheCapabilities, type CacheInvalidator, type CacheOptions, type CacheProvider, type CacheReader, type CacheState, type CacheStrategy, type CacheWriter, type CallProcedureOptions, Capitalize, type CascadeMode, type CaseExpressionNode, type CastExpressionNode, type CheckConstraint, type ChunkCompleteInfo, type ChunkOutcome, type CollateExpressionNode, Column, type ColumnDef, type ColumnDiff, type ColumnInput, type ColumnNode, type ColumnOptions, type ColumnRef, type ColumnToTs, type ColumnType, type ComponentOptions, type ComponentReference, type CompositeTransformer, ConflictBuilder, ConstructorMaterializationStrategy, type ValidationResult as CountryValidationResult, type CountryValidator, type CountryValidatorFactory, type CreateDto, type CreateTediousClientOptions, type CursorPageInfo, type CursorPageOptions, type CursorPageResult, DEFAULT_TREE_CONFIG, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DatabaseView, type DateFilter, DateTimeTypeStrategy, type DbExecutor, type DbExecutorFactory, DecimalTypeStrategy, type DecoratedEntityInstance, DefaultBelongsToReference, DefaultCacheStrategy, DefaultEntityMaterializer, DefaultHasManyCollection, DefaultManyToManyCollection, DefaultMorphManyCollection, DefaultMorphOneReference, DefaultMorphToReference, DefaultTypeStrategy, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, type Dto, type Duration, Email, Entity, type EntityContext, type EntityInstance, type EntityMaterializationStrategy, type EntityMaterializer, type EntityOptions, type PrimaryKey$1 as EntityPrimaryKey, EntityStatus, type ExecuteFilteredPagedOptions, type ExecutionContext, type ExecutionPayload, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type FieldFilter, type FilterOperator, type FilterValue, type FindChildrenOptions, type FindPathOptions, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, type HasOneReferenceApi, type HasOneRelation, type HydrationContext, type HydrationMetadata, type HydrationPivotPlan, type HydrationPlan, type HydrationRelationPlan, type InExpressionNode, type InExpressionRight, type IndexColumn, type IndexDef, type InferRow, type InitialHandlers, InsertQueryBuilder, type InsertRow, IntegerTypeStrategy, InterceptorPipeline, type IntrospectOptions, type InvalidationStrategy, type IsDistinctExpressionNode, type JsonArray, type JsonObject, type JsonPathNode, type JsonValue, type Jsonify, type JsonifyScalar, KeyvCacheAdapter, Length, type LiteralNode, type LiteralValue, type LogicalExpressionNode, Lower, type ManyToManyCollection, MemoryCacheAdapter, MorphMany, type MorphManyOptions, type MorphManyRelation, MorphOne, type MorphOneOptions, type MorphOneRelation, MorphTo, type MorphToOptions, type MorphToRelation, type MoveOptions, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NestedDtoOptions, type NestedSetBounds, type NestedSetRow, NestedSetStrategy, type NodeWithPk, type NotExpressionNode, type NullExpressionNode, type NumberFilter, type OpenApiComponent, type OpenApiDialect, type OpenApiDocument, type OpenApiDocumentInfo, type OpenApiDocumentOptions, type OpenApiOperation, type OpenApiParameter, type OpenApiParameterObject, type OpenApiResponseObject, type OpenApiSchema, type OpenApiType, type OperandNode, type OperandVisitor, Orm, type OrmCacheOptions, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, type PagedResponse, type PaginatedResult, type PaginationParams, type PatchGraphInputPayload, Pattern, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type Primitive, ProcedureCallBuilder, type ProcedureCallNode, type ProcedureDirection, type ProcedureExecutionResult, type ProcedureOutOptions, type ProcedureParamNode, type ProcedureRefNode, type PropertySanitizer, type PropertyTransformer, type PropertyValidator, PrototypeMaterializationStrategy, QueryCacheManager, type QueryContext, type QueryInterceptor, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type RecoverResult, RedisCacheAdapter, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationFilter, type RelationKey$1 as RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type SaveGraphSessionOptions, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SelectableKeys, type SimpleQueryRunner, type SimpleWhereInput, type Simplify, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type StringFilter, StringTypeStrategy, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, TagIndex, type TargetType, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, type ThreadedNode, Title, type ToJsonOptions, type TrackedEntity, type TransformContext, type TransformerConfig, type TransformerMetadata, Tree, TreeChildren, type TreeColumns, type TreeConfig, type TreeDecoratorOptions, type TreeInsertData, type TreeListEntry, type TreeListOptions, type TreeListSchemaOptions, TreeManager, type TreeManagerOptions, type TreeMetadata, type TreeMoveData, type TreeNode, type TreeNodeResult, type TreeNodeResultSchemaOptions, type TreeNodeSchemaOptions, TreeParent, type TreeQuery, type TreeScope, type TreeValidationResult, Trim, TypeMappingService, type TypeMappingStrategy, TypeScriptGenerator, type TypedExpression, type TypedLike, type UpdateDto, UpdateQueryBuilder, type UpdateRow, Upper, UuidTypeStrategy, type ValidationOptions, type ValidationResult$1 as ValidationResult, type ValidatorFactoryOptions, type ValueOperandInput, type WhereInput, type WindowFunctionNode, type WithRelations, abs, acos, add, addDomainEvent, addEntityRelation, addRelation, age, aliasRef, and, applyFilter, applyNullability, arrayAppend, asType, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bitAnd, bitLength, bitOr, bitXor, bootstrapEntities, buildFilterExpression, buildScopeConditions, bulkDelete, bulkDeleteWhere, bulkInsert, bulkUpdate, bulkUpdateWhere, bulkUpsert, calculateRowDepths, calculateTotalPages, callProcedure, canonicalizeSchema, caseWhen, cast, cbrt, ceil, ceiling, char, charLength, chr, clearExpressionDispatchers, clearOperandDispatchers, coalesce, col, collate, columnOperand, columnToFilterSchema, columnToOpenApiSchema, columnTypeToOpenApiFormat, columnTypeToOpenApiType, computePaginationMetadata, computeSchemaHash, concat, concatWs, correlateBy, cos, cot, count, countAll, createApiComponentsSection, createBetterSqlite3Executor, createDeterministicNamingState, createDtoToOpenApiSchema, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createRef, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, createTreeManager, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, deepCloneSchema, defineTable, degrees, deleteFrom, denseRank, diffSchema, div, dtoToOpenApiSchema, endOfMonth, entityRef, entityRefs, eq, esel, exclude, executeFilteredPaged, executeHydrated, executeHydratedPlain, executeHydratedPlainWithContexts, executeHydratedWithContexts, executeProcedureAst, executeSchemaSql, executeSchemaSqlFor, exists, exp, extract, extractReusableSchemas, extractScopeValues, firstValue, floor, formatDuration, formatTreeList, fromUnixTime, generateComponentSchemas, generateCreateTableSql, generateOpenApiDocument, generateRelationComponents, generateSchemaSql, generateSchemaSqlFor, generateTreeComponents, getColumn, getColumnMap, getColumnType, getDateKind, getDecoratorMetadata, getDeterministicComponentName, getOpenApiVersionForDialect, getRegisteredValidators, getSchemaIntrospector, getTableDefFromEntity, getTreeBounds, getTreeColumns, getTreeConfig, getTreeMetadata, getTreeParentId, greatest, groupConcat, gt, gte, hasMany, hasNextPage as hasNextPageMeta, hasOne, hasPrevPage as hasPrevPageMeta, hasTreeBehavior, hasValidator, hour, hydrateRows, ifNull, inList, inSubquery, initcap, insertInto, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isCollateExpressionNode, isComponentReference, isDistinctFrom, isExpressionSelectionNode, isFunctionNode, isMorphRelation, isNotDistinctFrom, isNotNull, isNull, isNullableColumn, isOperandNode, isSingleTargetRelation, isTableDef, isTreeConfig, isValidDuration, isValueOperandInput, isWindowFunctionNode, jsonArrayAgg, jsonContains, jsonLength, jsonPath, jsonSet, jsonify, lag, lastValue, lead, least, left, length, like, ln, loadBelongsToManyRelation, loadBelongsToRelation, loadHasManyRelation, loadHasOneRelation, loadMorphManyRelation, loadMorphOneRelation, loadMorphToRelation, localTime, localTimestamp, locate, log, log10, log2, logBase, lower, lpad, lt, lte, ltrim, mapFields, materializeAs, max, md5, mergeSchemas, min, minute, mod, month, morphMany, morphOne, morphTo, mul, neq, nestedDtoToOpenApiSchema, nestedWhereInputToOpenApiSchema, normalizeColumnType, not, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, nullif, octetLength, or, outerRef, pagedResponseToOpenApiSchema, paginationParamsSchema, parameterToRef, parseDuration, payloadResultSets, pi, pick, position, pow, power, quarter, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, registerValidator, relationFilterToOpenApiSchema, relationLoaderCache, renderColumnDefinition, renderTypeWithArgs, repeat, replace, replaceWithRefs, resolveTreeConfig, resolveValidator, responseToRef, reverse, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, schemaToJson, schemaToRef, second, sel, selectFrom, selectFromEntity, setRelations, setTreeBounds, setTreeMetadata, setTreeParentId, sha1, sha2, shiftLeft, shiftRight, sign, sin, space, sqrt, stddev, sub, substr, sum, syncTreeEntityMetadata, synchronizeSchema, tableRef, tan, threadResults, threadedNodeToOpenApiSchema, toColumnRef, toExecutionPayload, toPagedResponse, toPagedResponseBuilder, toPaginationParams, toResponse, toResponseBuilder, toTableRef, treeEntityRegistry, treeListEntryToOpenApiSchema, treeNodeResultToOpenApiSchema, treeNodeToOpenApiSchema, treeQuery, trim, trunc, truncate, typeMappingService, unixTimestamp, update, updateDtoToOpenApiSchema, updateDtoWithRelationsToOpenApiSchema, upper, utcNow, validateTreeTable, valueToOperand, variance, visitExpression, visitOperand, weekOfYear, whereInputToOpenApiSchema, whereInputWithRelationsToOpenApiSchema, windowFunction, withDefaults, withDefaultsBuilder, year };