metal-orm 1.0.55 → 1.0.57

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 (72) hide show
  1. package/README.md +21 -20
  2. package/dist/index.cjs +831 -113
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +524 -71
  5. package/dist/index.d.ts +524 -71
  6. package/dist/index.js +794 -113
  7. package/dist/index.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/codegen/naming-strategy.ts +3 -1
  10. package/src/codegen/typescript.ts +20 -10
  11. package/src/core/ast/aggregate-functions.ts +14 -0
  12. package/src/core/ast/builders.ts +38 -20
  13. package/src/core/ast/expression-builders.ts +70 -2
  14. package/src/core/ast/expression-nodes.ts +305 -274
  15. package/src/core/ast/expression-visitor.ts +11 -1
  16. package/src/core/ast/expression.ts +4 -0
  17. package/src/core/ast/query.ts +3 -0
  18. package/src/core/ddl/introspect/catalogs/mysql.ts +5 -0
  19. package/src/core/ddl/introspect/catalogs/sqlite.ts +3 -0
  20. package/src/core/ddl/introspect/functions/mssql.ts +13 -0
  21. package/src/core/ddl/introspect/mssql.ts +4 -0
  22. package/src/core/ddl/introspect/mysql.ts +4 -0
  23. package/src/core/ddl/introspect/sqlite.ts +4 -0
  24. package/src/core/dialect/abstract.ts +552 -531
  25. package/src/core/dialect/base/function-table-formatter.ts +9 -30
  26. package/src/core/dialect/base/sql-dialect.ts +24 -0
  27. package/src/core/dialect/mssql/functions.ts +40 -2
  28. package/src/core/dialect/mysql/functions.ts +16 -2
  29. package/src/core/dialect/postgres/functions.ts +66 -2
  30. package/src/core/dialect/postgres/index.ts +17 -4
  31. package/src/core/dialect/postgres/table-functions.ts +27 -0
  32. package/src/core/dialect/sqlite/functions.ts +34 -0
  33. package/src/core/dialect/sqlite/index.ts +17 -1
  34. package/src/core/driver/database-driver.ts +9 -1
  35. package/src/core/driver/mssql-driver.ts +3 -0
  36. package/src/core/driver/mysql-driver.ts +3 -0
  37. package/src/core/driver/postgres-driver.ts +3 -0
  38. package/src/core/driver/sqlite-driver.ts +3 -0
  39. package/src/core/execution/executors/mssql-executor.ts +5 -0
  40. package/src/core/execution/executors/mysql-executor.ts +5 -0
  41. package/src/core/execution/executors/postgres-executor.ts +5 -0
  42. package/src/core/execution/executors/sqlite-executor.ts +5 -0
  43. package/src/core/functions/array.ts +26 -0
  44. package/src/core/functions/control-flow.ts +69 -0
  45. package/src/core/functions/datetime.ts +50 -0
  46. package/src/core/functions/definitions/aggregate.ts +16 -0
  47. package/src/core/functions/definitions/control-flow.ts +24 -0
  48. package/src/core/functions/definitions/datetime.ts +36 -0
  49. package/src/core/functions/definitions/helpers.ts +29 -0
  50. package/src/core/functions/definitions/json.ts +49 -0
  51. package/src/core/functions/definitions/numeric.ts +55 -0
  52. package/src/core/functions/definitions/string.ts +43 -0
  53. package/src/core/functions/function-registry.ts +48 -0
  54. package/src/core/functions/group-concat-helpers.ts +57 -0
  55. package/src/core/functions/json.ts +38 -0
  56. package/src/core/functions/numeric.ts +14 -0
  57. package/src/core/functions/standard-strategy.ts +86 -115
  58. package/src/core/functions/standard-table-strategy.ts +13 -0
  59. package/src/core/functions/table-types.ts +15 -0
  60. package/src/core/functions/text.ts +57 -0
  61. package/src/core/sql/sql.ts +59 -38
  62. package/src/decorators/bootstrap.ts +5 -4
  63. package/src/index.ts +18 -11
  64. package/src/orm/hydration-context.ts +10 -0
  65. package/src/orm/identity-map.ts +19 -0
  66. package/src/orm/interceptor-pipeline.ts +4 -0
  67. package/src/orm/relations/belongs-to.ts +17 -0
  68. package/src/orm/relations/has-one.ts +17 -0
  69. package/src/orm/relations/many-to-many.ts +41 -0
  70. package/src/query-builder/select.ts +68 -68
  71. package/src/schema/table-guards.ts +6 -0
  72. package/src/schema/types.ts +8 -1
package/dist/index.d.cts CHANGED
@@ -533,6 +533,25 @@ declare const SQL_OPERATORS: {
533
533
  /** NOT EXISTS operator */
534
534
  readonly NOT_EXISTS: "NOT EXISTS";
535
535
  };
536
+ /**
537
+ * SQL bitwise operators
538
+ */
539
+ declare const BITWISE_OPERATORS: {
540
+ /** Bitwise AND */
541
+ readonly AND: "&";
542
+ /** Bitwise OR */
543
+ readonly OR: "|";
544
+ /** Bitwise XOR */
545
+ readonly XOR: "^";
546
+ /** Bitwise Shift Left */
547
+ readonly SHIFT_LEFT: "<<";
548
+ /** Bitwise Shift Right */
549
+ readonly SHIFT_RIGHT: ">>";
550
+ };
551
+ /**
552
+ * Type representing supported bitwise operators
553
+ */
554
+ type BitwiseOperator = (typeof BITWISE_OPERATORS)[keyof typeof BITWISE_OPERATORS];
536
555
  /**
537
556
  * Type representing any supported SQL operator
538
557
  */
@@ -705,6 +724,16 @@ interface CastExpressionNode {
705
724
  /** Optional alias for the result */
706
725
  alias?: string;
707
726
  }
727
+ /**
728
+ * AST node representing a COLLATE expression (expression COLLATE collationName).
729
+ */
730
+ interface CollateExpressionNode {
731
+ type: 'Collate';
732
+ /** Expression to be collated */
733
+ expression: OperandNode;
734
+ /** Collation name */
735
+ collation: string;
736
+ }
708
737
  /**
709
738
  * AST node representing a window function
710
739
  */
@@ -733,11 +762,12 @@ interface ArithmeticExpressionNode {
733
762
  /**
734
763
  * Union type representing any operand that can be used in expressions
735
764
  */
736
- type OperandNode = AliasRefNode | ColumnNode | LiteralNode | FunctionNode | JsonPathNode | ScalarSubqueryNode | CaseExpressionNode | CastExpressionNode | WindowFunctionNode | ArithmeticExpressionNode;
765
+ type OperandNode = AliasRefNode | ColumnNode | LiteralNode | FunctionNode | JsonPathNode | ScalarSubqueryNode | CaseExpressionNode | CastExpressionNode | WindowFunctionNode | ArithmeticExpressionNode | BitwiseExpressionNode | CollateExpressionNode;
737
766
  declare const isOperandNode: (node: unknown) => node is OperandNode;
738
767
  declare const isFunctionNode: (node: unknown) => node is FunctionNode;
739
768
  declare const isCaseExpressionNode: (node: unknown) => node is CaseExpressionNode;
740
769
  declare const isCastExpressionNode: (node: unknown) => node is CastExpressionNode;
770
+ declare const isCollateExpressionNode: (node: unknown) => node is CollateExpressionNode;
741
771
  declare const isWindowFunctionNode: (node: unknown) => node is WindowFunctionNode;
742
772
  declare const isExpressionSelectionNode: (node: ColumnRef | FunctionNode | CaseExpressionNode | CastExpressionNode | WindowFunctionNode) => node is FunctionNode | CaseExpressionNode | CastExpressionNode | WindowFunctionNode;
743
773
  /**
@@ -754,6 +784,18 @@ interface BinaryExpressionNode {
754
784
  /** Optional escape character for LIKE expressions */
755
785
  escape?: LiteralNode;
756
786
  }
787
+ /**
788
+ * AST node representing a bitwise expression (e.g., a & b)
789
+ */
790
+ interface BitwiseExpressionNode {
791
+ type: 'BitwiseExpression';
792
+ /** Left operand */
793
+ left: OperandNode;
794
+ /** Bitwise operator */
795
+ operator: BitwiseOperator;
796
+ /** Right operand */
797
+ right: OperandNode;
798
+ }
757
799
  /**
758
800
  * AST node representing a logical expression (AND/OR)
759
801
  */
@@ -813,7 +855,7 @@ interface BetweenExpressionNode {
813
855
  /**
814
856
  * Union type representing any supported expression node
815
857
  */
816
- type ExpressionNode = BinaryExpressionNode | LogicalExpressionNode | NullExpressionNode | InExpressionNode | ExistsExpressionNode | BetweenExpressionNode | ArithmeticExpressionNode;
858
+ type ExpressionNode = BinaryExpressionNode | LogicalExpressionNode | NullExpressionNode | InExpressionNode | ExistsExpressionNode | BetweenExpressionNode | ArithmeticExpressionNode | BitwiseExpressionNode;
817
859
 
818
860
  type LiteralValue = LiteralNode['value'];
819
861
  type ValueOperandInput = OperandNode | LiteralValue;
@@ -956,6 +998,26 @@ declare const add: (left: OperandNode | ColumnRef, right: OperandNode | ColumnRe
956
998
  declare const sub: (left: OperandNode | ColumnRef, right: OperandNode | ColumnRef | string | number) => ArithmeticExpressionNode;
957
999
  declare const mul: (left: OperandNode | ColumnRef, right: OperandNode | ColumnRef | string | number) => ArithmeticExpressionNode;
958
1000
  declare const div: (left: OperandNode | ColumnRef, right: OperandNode | ColumnRef | string | number) => ArithmeticExpressionNode;
1001
+ /**
1002
+ * Creates a bitwise AND expression (left & right)
1003
+ */
1004
+ declare const bitAnd: (left: OperandNode | ColumnRef, right: OperandNode | ColumnRef | string | number) => BitwiseExpressionNode;
1005
+ /**
1006
+ * Creates a bitwise OR expression (left | right)
1007
+ */
1008
+ declare const bitOr: (left: OperandNode | ColumnRef, right: OperandNode | ColumnRef | string | number) => BitwiseExpressionNode;
1009
+ /**
1010
+ * Creates a bitwise XOR expression (left ^ right)
1011
+ */
1012
+ declare const bitXor: (left: OperandNode | ColumnRef, right: OperandNode | ColumnRef | string | number) => BitwiseExpressionNode;
1013
+ /**
1014
+ * Creates a bitwise shift left expression (left << right)
1015
+ */
1016
+ declare const shiftLeft: (left: OperandNode | ColumnRef, right: OperandNode | ColumnRef | string | number) => BitwiseExpressionNode;
1017
+ /**
1018
+ * Creates a bitwise shift right expression (left >> right)
1019
+ */
1020
+ declare const shiftRight: (left: OperandNode | ColumnRef, right: OperandNode | ColumnRef | string | number) => BitwiseExpressionNode;
959
1021
  /**
960
1022
  * Creates a JSON path expression
961
1023
  * @param col - Source column
@@ -989,6 +1051,13 @@ declare const exists: (subquery: SelectQueryNode) => ExistsExpressionNode;
989
1051
  * @returns NOT EXISTS expression node
990
1052
  */
991
1053
  declare const notExists: (subquery: SelectQueryNode) => ExistsExpressionNode;
1054
+ /**
1055
+ * Creates a COLLATE expression (expression COLLATE collationName)
1056
+ * @param expression - Expression to be collated
1057
+ * @param collation - Collation name
1058
+ * @returns COLLATE expression node
1059
+ */
1060
+ declare const collate: (expression: OperandNode | ColumnRef | string | number | boolean | null, collation: string) => CollateExpressionNode;
992
1061
 
993
1062
  /**
994
1063
  * Creates a ROW_NUMBER window function
@@ -1099,6 +1168,18 @@ type GroupConcatOptions = {
1099
1168
  * Aggregates grouped strings into a single value.
1100
1169
  */
1101
1170
  declare const groupConcat: (col: ColumnRef | ColumnNode, options?: GroupConcatOptions) => FunctionNode;
1171
+ /**
1172
+ * Creates a STDDEV function expression
1173
+ * @param col - Column to calculate standard deviation for
1174
+ * @returns Function node with STDDEV
1175
+ */
1176
+ declare const stddev: (col: ColumnRef | ColumnNode) => FunctionNode;
1177
+ /**
1178
+ * Creates a VARIANCE function expression
1179
+ * @param col - Column to calculate variance for
1180
+ * @returns Function node with VARIANCE
1181
+ */
1182
+ declare const variance: (col: ColumnRef | ColumnNode) => FunctionNode;
1102
1183
 
1103
1184
  /**
1104
1185
  * Visitor for expression nodes
@@ -1111,6 +1192,7 @@ interface ExpressionVisitor<R> {
1111
1192
  visitExistsExpression?(node: ExistsExpressionNode): R;
1112
1193
  visitBetweenExpression?(node: BetweenExpressionNode): R;
1113
1194
  visitArithmeticExpression?(node: ArithmeticExpressionNode): R;
1195
+ visitBitwiseExpression?(node: BitwiseExpressionNode): R;
1114
1196
  otherwise?(node: ExpressionNode): R;
1115
1197
  }
1116
1198
  /**
@@ -1125,6 +1207,7 @@ interface OperandVisitor<R> {
1125
1207
  visitCaseExpression?(node: CaseExpressionNode): R;
1126
1208
  visitCast?(node: CastExpressionNode): R;
1127
1209
  visitWindowFunction?(node: WindowFunctionNode): R;
1210
+ visitCollate?(node: CollateExpressionNode): R;
1128
1211
  visitAliasRef?(node: AliasRefNode): R;
1129
1212
  otherwise?(node: OperandNode): R;
1130
1213
  }
@@ -1199,6 +1282,7 @@ interface TableNode {
1199
1282
  */
1200
1283
  interface FunctionTableNode {
1201
1284
  type: 'FunctionTable';
1285
+ key?: string;
1202
1286
  /** Function name */
1203
1287
  name: string;
1204
1288
  /** Optional schema for the function (some dialects) */
@@ -1445,6 +1529,17 @@ interface FunctionStrategy {
1445
1529
  getRenderer(functionName: string): FunctionRenderer | undefined;
1446
1530
  }
1447
1531
 
1532
+ interface TableFunctionRenderContext {
1533
+ node: FunctionTableNode;
1534
+ compiledArgs: string[];
1535
+ compileOperand: (operand: OperandNode) => string;
1536
+ quoteIdentifier: (id: string) => string;
1537
+ }
1538
+ type TableFunctionRenderer = (ctx: TableFunctionRenderContext) => string;
1539
+ interface TableFunctionStrategy {
1540
+ getRenderer(key: string): TableFunctionRenderer | undefined;
1541
+ }
1542
+
1448
1543
  /**
1449
1544
  * Context for SQL compilation with parameter management
1450
1545
  */
@@ -1564,13 +1659,14 @@ declare abstract class Dialect implements SelectCompiler, InsertCompiler, Update
1564
1659
  private readonly expressionCompilers;
1565
1660
  private readonly operandCompilers;
1566
1661
  protected readonly functionStrategy: FunctionStrategy;
1567
- protected constructor(functionStrategy?: FunctionStrategy);
1662
+ protected readonly tableFunctionStrategy: TableFunctionStrategy;
1663
+ protected constructor(functionStrategy?: FunctionStrategy, tableFunctionStrategy?: TableFunctionStrategy);
1568
1664
  /**
1569
1665
  * Creates a new Dialect instance (for testing purposes)
1570
1666
  * @param functionStrategy - Optional function strategy
1571
1667
  * @returns New Dialect instance
1572
1668
  */
1573
- static create(functionStrategy?: FunctionStrategy): Dialect;
1669
+ static create(functionStrategy?: FunctionStrategy, tableFunctionStrategy?: TableFunctionStrategy): Dialect;
1574
1670
  /**
1575
1671
  * Registers an expression compiler for a specific node type
1576
1672
  * @param type - Expression node type
@@ -2353,6 +2449,80 @@ type EntityOrTableTarget = EntityConstructor | TableDef;
2353
2449
  * Resolver for entity or table target, can be direct or function.
2354
2450
  */
2355
2451
  type EntityOrTableTargetResolver = EntityOrTableTarget | (() => EntityOrTableTarget);
2452
+ /**
2453
+ * Simplified column definition structure used during metadata registration.
2454
+ * @template T - Concrete column definition type being extended
2455
+ */
2456
+ type ColumnDefLike<T extends ColumnDef = ColumnDef> = Omit<T, 'name' | 'table'>;
2457
+ /**
2458
+ * Common properties shared by all relation metadata types.
2459
+ */
2460
+ interface BaseRelationMetadata {
2461
+ /** The property key for the relation */
2462
+ propertyKey: string;
2463
+ /** The target entity or table */
2464
+ target: EntityOrTableTargetResolver;
2465
+ /** Optional cascade mode */
2466
+ cascade?: CascadeMode;
2467
+ }
2468
+ /**
2469
+ * Metadata for has many relations.
2470
+ */
2471
+ interface HasManyRelationMetadata extends BaseRelationMetadata {
2472
+ /** The relation kind */
2473
+ kind: typeof RelationKinds.HasMany;
2474
+ /** The foreign key */
2475
+ foreignKey: string;
2476
+ /** Optional local key */
2477
+ localKey?: string;
2478
+ }
2479
+ /**
2480
+ * Metadata for has one relations.
2481
+ */
2482
+ interface HasOneRelationMetadata extends BaseRelationMetadata {
2483
+ /** The relation kind */
2484
+ kind: typeof RelationKinds.HasOne;
2485
+ /** The foreign key */
2486
+ foreignKey: string;
2487
+ /** Optional local key */
2488
+ localKey?: string;
2489
+ }
2490
+ /**
2491
+ * Metadata for belongs to relations.
2492
+ */
2493
+ interface BelongsToRelationMetadata extends BaseRelationMetadata {
2494
+ /** The relation kind */
2495
+ kind: typeof RelationKinds.BelongsTo;
2496
+ /** The foreign key */
2497
+ foreignKey: string;
2498
+ /** Optional local key */
2499
+ localKey?: string;
2500
+ }
2501
+ /**
2502
+ * Metadata for belongs to many relations.
2503
+ */
2504
+ interface BelongsToManyRelationMetadata extends BaseRelationMetadata {
2505
+ /** The relation kind */
2506
+ kind: typeof RelationKinds.BelongsToMany;
2507
+ /** The pivot table */
2508
+ pivotTable: EntityOrTableTargetResolver;
2509
+ /** The pivot foreign key to root */
2510
+ pivotForeignKeyToRoot: string;
2511
+ /** The pivot foreign key to target */
2512
+ pivotForeignKeyToTarget: string;
2513
+ /** Optional local key */
2514
+ localKey?: string;
2515
+ /** Optional target key */
2516
+ targetKey?: string;
2517
+ /** Optional pivot primary key */
2518
+ pivotPrimaryKey?: string;
2519
+ /** Optional default pivot columns */
2520
+ defaultPivotColumns?: string[];
2521
+ }
2522
+ /**
2523
+ * Union type for all relation metadata.
2524
+ */
2525
+ type RelationMetadata = HasManyRelationMetadata | HasOneRelationMetadata | BelongsToRelationMetadata | BelongsToManyRelationMetadata;
2356
2526
 
2357
2527
  /**
2358
2528
  * Entity status enum representing the lifecycle state of an entity
@@ -2472,6 +2642,10 @@ interface QueryContext {
2472
2642
  params: unknown[];
2473
2643
  }
2474
2644
  type QueryInterceptor = (ctx: QueryContext, next: () => Promise<QueryResult[]>) => Promise<QueryResult[]>;
2645
+ /**
2646
+ * Pipeline for query interceptors.
2647
+ * Interceptors can wrap query execution to add logging, tracing, caching, etc.
2648
+ */
2475
2649
  declare class InterceptorPipeline {
2476
2650
  private interceptors;
2477
2651
  use(interceptor: QueryInterceptor): void;
@@ -2547,12 +2721,31 @@ declare class Orm<E extends DomainEvent = OrmDomainEvent> {
2547
2721
  dispose(): Promise<void>;
2548
2722
  }
2549
2723
 
2724
+ /**
2725
+ * Simple identity map for tracking entities within a session.
2726
+ * Ensures that the same database record is represented by a single entity instance.
2727
+ */
2550
2728
  declare class IdentityMap {
2551
2729
  private readonly buckets;
2552
2730
  get bucketsMap(): Map<string, Map<string, TrackedEntity>>;
2731
+ /**
2732
+ * Retrieves an entity from the identity map if it exists.
2733
+ * @param table The table definition of the entity.
2734
+ * @param pk The primary key value.
2735
+ * @returns The entity instance if found, undefined otherwise.
2736
+ */
2553
2737
  getEntity(table: TableDef, pk: string | number): unknown | undefined;
2738
+ /**
2739
+ * Registers a tracked entity in the identity map.
2740
+ * @param tracked The tracked entity metadata and instance.
2741
+ */
2554
2742
  register(tracked: TrackedEntity): void;
2555
2743
  remove(tracked: TrackedEntity): void;
2744
+ /**
2745
+ * Returns all tracked entities for a specific table.
2746
+ * @param table The table definition.
2747
+ * @returns Array of tracked entities.
2748
+ */
2556
2749
  getEntitiesForTable(table: TableDef): TrackedEntity[];
2557
2750
  clear(): void;
2558
2751
  private toIdentityKey;
@@ -2980,11 +3173,21 @@ interface EntityContext {
2980
3173
  registerRelationChange(root: unknown, relationKey: RelationKey, rootTable: TableDef, relationName: string, relation: RelationDef, change: RelationChange<unknown>): void;
2981
3174
  }
2982
3175
 
3176
+ /**
3177
+ * Context used during the hydration of entities from database results.
3178
+ * It carries necessary services and processors to handle identity management,
3179
+ * unit of work registration, and relation changes.
3180
+ */
2983
3181
  interface HydrationContext<E extends DomainEvent = AnyDomainEvent> {
3182
+ /** The identity map used to track and reuse entity instances. */
2984
3183
  identityMap: IdentityMap;
3184
+ /** The unit of work used to track changes in hydrated entities. */
2985
3185
  unitOfWork: UnitOfWork;
3186
+ /** The bus used to dispatch domain events during or after hydration. */
2986
3187
  domainEvents: DomainEventBus<E, OrmSession<E>>;
3188
+ /** Processor for handling changes in entity relations during hydration. */
2987
3189
  relationChanges: RelationChangeProcessor;
3190
+ /** Context providing access to entity-specific metadata and services. */
2988
3191
  entityContext: EntityContext;
2989
3192
  }
2990
3193
 
@@ -3215,7 +3418,7 @@ declare class OrmSession<E extends DomainEvent = OrmDomainEvent> implements Enti
3215
3418
  */
3216
3419
  remove(entity: object): Promise<void>;
3217
3420
  /**
3218
- * Flushes pending changes to the database.
3421
+ * Flushes pending changes to the database without session hooks, relation processing, or domain events.
3219
3422
  */
3220
3423
  flush(): Promise<void>;
3221
3424
  /**
@@ -4062,6 +4265,11 @@ interface ReturningStrategy {
4062
4265
  formatReturningColumns(returning: ColumnNode[], quoteIdentifier: (id: string) => string): string;
4063
4266
  }
4064
4267
 
4268
+ /**
4269
+ * Base class for SQL dialects.
4270
+ * Provides a common framework for compiling AST nodes into SQL strings.
4271
+ * Specific dialects should extend this class and implement dialect-specific logic.
4272
+ */
4065
4273
  declare abstract class SqlDialectBase extends Dialect {
4066
4274
  abstract quoteIdentifier(id: string): string;
4067
4275
  protected paginationStrategy: PaginationStrategy;
@@ -4431,75 +4639,75 @@ declare const registerSchemaIntrospector: (dialect: DialectName, introspector: S
4431
4639
  */
4432
4640
  declare const getSchemaIntrospector: (dialect: DialectName) => SchemaIntrospector | undefined;
4433
4641
 
4434
- type OperandInput$2 = OperandNode | ColumnDef | string | number | boolean | null;
4642
+ type OperandInput$5 = OperandNode | ColumnDef | string | number | boolean | null;
4435
4643
  /**
4436
4644
  * Converts a string to lowercase.
4437
4645
  * @param value - The string value.
4438
4646
  * @returns A FunctionNode representing the LOWER SQL function.
4439
4647
  */
4440
- declare const lower: (value: OperandInput$2) => FunctionNode;
4648
+ declare const lower: (value: OperandInput$5) => FunctionNode;
4441
4649
  /**
4442
4650
  * Converts a string to uppercase.
4443
4651
  * @param value - The string value.
4444
4652
  * @returns A FunctionNode representing the UPPER SQL function.
4445
4653
  */
4446
- declare const upper: (value: OperandInput$2) => FunctionNode;
4654
+ declare const upper: (value: OperandInput$5) => FunctionNode;
4447
4655
  /**
4448
4656
  * Returns the ASCII code of the first character of a string.
4449
4657
  * @param value - The string value.
4450
4658
  * @returns A FunctionNode representing the ASCII SQL function.
4451
4659
  */
4452
- declare const ascii: (value: OperandInput$2) => FunctionNode;
4660
+ declare const ascii: (value: OperandInput$5) => FunctionNode;
4453
4661
  /**
4454
4662
  * Returns a string from one or more ASCII codes.
4455
4663
  * @param codes - The ASCII codes.
4456
4664
  * @returns A FunctionNode representing the CHAR SQL function.
4457
4665
  */
4458
- declare const char: (...codes: OperandInput$2[]) => FunctionNode;
4666
+ declare const char: (...codes: OperandInput$5[]) => FunctionNode;
4459
4667
  /**
4460
4668
  * Returns the number of characters in a string.
4461
4669
  * @param value - The string value.
4462
4670
  * @returns A FunctionNode representing the CHAR_LENGTH SQL function.
4463
4671
  */
4464
- declare const charLength: (value: OperandInput$2) => FunctionNode;
4672
+ declare const charLength: (value: OperandInput$5) => FunctionNode;
4465
4673
  /**
4466
4674
  * Returns the length of a string in bytes or characters.
4467
4675
  * @param value - The string value.
4468
4676
  * @returns A FunctionNode representing the LENGTH SQL function.
4469
4677
  */
4470
- declare const length: (value: OperandInput$2) => FunctionNode;
4678
+ declare const length: (value: OperandInput$5) => FunctionNode;
4471
4679
  /**
4472
4680
  * Removes leading and trailing whitespace or specified characters from a string.
4473
4681
  * @param value - The string value.
4474
4682
  * @param chars - The characters to trim (optional).
4475
4683
  * @returns A FunctionNode representing the TRIM SQL function.
4476
4684
  */
4477
- declare const trim: (value: OperandInput$2, chars?: OperandInput$2) => FunctionNode;
4685
+ declare const trim: (value: OperandInput$5, chars?: OperandInput$5) => FunctionNode;
4478
4686
  /**
4479
4687
  * Removes leading whitespace from a string.
4480
4688
  * @param value - The string value.
4481
4689
  * @returns A FunctionNode representing the LTRIM SQL function.
4482
4690
  */
4483
- declare const ltrim: (value: OperandInput$2) => FunctionNode;
4691
+ declare const ltrim: (value: OperandInput$5) => FunctionNode;
4484
4692
  /**
4485
4693
  * Removes trailing whitespace from a string.
4486
4694
  * @param value - The string value.
4487
4695
  * @returns A FunctionNode representing the RTRIM SQL function.
4488
4696
  */
4489
- declare const rtrim: (value: OperandInput$2) => FunctionNode;
4697
+ declare const rtrim: (value: OperandInput$5) => FunctionNode;
4490
4698
  /**
4491
4699
  * Concatenates two or more strings.
4492
4700
  * @param args - The strings to concatenate.
4493
4701
  * @returns A FunctionNode representing the CONCAT SQL function.
4494
4702
  */
4495
- declare const concat: (...args: OperandInput$2[]) => FunctionNode;
4703
+ declare const concat: (...args: OperandInput$5[]) => FunctionNode;
4496
4704
  /**
4497
4705
  * Concatenates strings with a separator.
4498
4706
  * @param separator - The separator string.
4499
4707
  * @param args - The strings to concatenate.
4500
4708
  * @returns A FunctionNode representing the CONCAT_WS SQL function.
4501
4709
  */
4502
- declare const concatWs: (separator: OperandInput$2, ...args: OperandInput$2[]) => FunctionNode;
4710
+ declare const concatWs: (separator: OperandInput$5, ...args: OperandInput$5[]) => FunctionNode;
4503
4711
  /**
4504
4712
  * Extracts a substring from a string.
4505
4713
  * @param value - The string value.
@@ -4507,35 +4715,35 @@ declare const concatWs: (separator: OperandInput$2, ...args: OperandInput$2[]) =
4507
4715
  * @param length - The length of the substring (optional).
4508
4716
  * @returns A FunctionNode representing the SUBSTR SQL function.
4509
4717
  */
4510
- declare const substr: (value: OperandInput$2, start: OperandInput$2, length?: OperandInput$2) => FunctionNode;
4718
+ declare const substr: (value: OperandInput$5, start: OperandInput$5, length?: OperandInput$5) => FunctionNode;
4511
4719
  /**
4512
4720
  * Returns the leftmost characters of a string.
4513
4721
  * @param value - The string value.
4514
4722
  * @param len - The number of characters to return.
4515
4723
  * @returns A FunctionNode representing the LEFT SQL function.
4516
4724
  */
4517
- declare const left: (value: OperandInput$2, len: OperandInput$2) => FunctionNode;
4725
+ declare const left: (value: OperandInput$5, len: OperandInput$5) => FunctionNode;
4518
4726
  /**
4519
4727
  * Returns the rightmost characters of a string.
4520
4728
  * @param value - The string value.
4521
4729
  * @param len - The number of characters to return.
4522
4730
  * @returns A FunctionNode representing the RIGHT SQL function.
4523
4731
  */
4524
- declare const right: (value: OperandInput$2, len: OperandInput$2) => FunctionNode;
4732
+ declare const right: (value: OperandInput$5, len: OperandInput$5) => FunctionNode;
4525
4733
  /**
4526
4734
  * Returns the position of a substring in a string.
4527
4735
  * @param substring - The substring to search for.
4528
4736
  * @param value - The string to search in.
4529
4737
  * @returns A FunctionNode representing the POSITION SQL function.
4530
4738
  */
4531
- declare const position: (substring: OperandInput$2, value: OperandInput$2) => FunctionNode;
4739
+ declare const position: (substring: OperandInput$5, value: OperandInput$5) => FunctionNode;
4532
4740
  /**
4533
4741
  * Returns the position of a substring in a string.
4534
4742
  * @param value - The string to search in.
4535
4743
  * @param substring - The substring to search for.
4536
4744
  * @returns A FunctionNode representing the INSTR SQL function.
4537
4745
  */
4538
- declare const instr: (value: OperandInput$2, substring: OperandInput$2) => FunctionNode;
4746
+ declare const instr: (value: OperandInput$5, substring: OperandInput$5) => FunctionNode;
4539
4747
  /**
4540
4748
  * Returns the position of a substring in a string, optionally starting from a position.
4541
4749
  * @param substring - The substring to search for.
@@ -4543,7 +4751,7 @@ declare const instr: (value: OperandInput$2, substring: OperandInput$2) => Funct
4543
4751
  * @param start - The starting position (optional).
4544
4752
  * @returns A FunctionNode representing the LOCATE SQL function.
4545
4753
  */
4546
- declare const locate: (substring: OperandInput$2, value: OperandInput$2, start?: OperandInput$2) => FunctionNode;
4754
+ declare const locate: (substring: OperandInput$5, value: OperandInput$5, start?: OperandInput$5) => FunctionNode;
4547
4755
  /**
4548
4756
  * Replaces occurrences of a substring in a string.
4549
4757
  * @param value - The string to search in.
@@ -4551,14 +4759,14 @@ declare const locate: (substring: OperandInput$2, value: OperandInput$2, start?:
4551
4759
  * @param replacement - The replacement string.
4552
4760
  * @returns A FunctionNode representing the REPLACE SQL function.
4553
4761
  */
4554
- declare const replace: (value: OperandInput$2, search: OperandInput$2, replacement: OperandInput$2) => FunctionNode;
4762
+ declare const replace: (value: OperandInput$5, search: OperandInput$5, replacement: OperandInput$5) => FunctionNode;
4555
4763
  /**
4556
4764
  * Repeats a string a specified number of times.
4557
4765
  * @param value - The string to repeat.
4558
4766
  * @param count - The number of times to repeat.
4559
4767
  * @returns A FunctionNode representing the REPEAT SQL function.
4560
4768
  */
4561
- declare const repeat: (value: OperandInput$2, count: OperandInput$2) => FunctionNode;
4769
+ declare const repeat: (value: OperandInput$5, count: OperandInput$5) => FunctionNode;
4562
4770
  /**
4563
4771
  * Left-pads a string to a certain length with another string.
4564
4772
  * @param value - The string to pad.
@@ -4566,7 +4774,7 @@ declare const repeat: (value: OperandInput$2, count: OperandInput$2) => Function
4566
4774
  * @param pad - The padding string.
4567
4775
  * @returns A FunctionNode representing the LPAD SQL function.
4568
4776
  */
4569
- declare const lpad: (value: OperandInput$2, len: OperandInput$2, pad: OperandInput$2) => FunctionNode;
4777
+ declare const lpad: (value: OperandInput$5, len: OperandInput$5, pad: OperandInput$5) => FunctionNode;
4570
4778
  /**
4571
4779
  * Right-pads a string to a certain length with another string.
4572
4780
  * @param value - The string to pad.
@@ -4574,120 +4782,169 @@ declare const lpad: (value: OperandInput$2, len: OperandInput$2, pad: OperandInp
4574
4782
  * @param pad - The padding string.
4575
4783
  * @returns A FunctionNode representing the RPAD SQL function.
4576
4784
  */
4577
- declare const rpad: (value: OperandInput$2, len: OperandInput$2, pad: OperandInput$2) => FunctionNode;
4785
+ declare const rpad: (value: OperandInput$5, len: OperandInput$5, pad: OperandInput$5) => FunctionNode;
4578
4786
  /**
4579
4787
  * Returns a string consisting of a specified number of spaces.
4580
4788
  * @param count - The number of spaces.
4581
4789
  * @returns A FunctionNode representing the SPACE SQL function.
4582
4790
  */
4583
- declare const space: (count: OperandInput$2) => FunctionNode;
4791
+ declare const space: (count: OperandInput$5) => FunctionNode;
4792
+ /**
4793
+ * Reverses a string.
4794
+ * @param value - The string value.
4795
+ * @returns A FunctionNode representing the REVERSE SQL function.
4796
+ */
4797
+ declare const reverse: (value: OperandInput$5) => FunctionNode;
4798
+ /**
4799
+ * Capitalizes the first letter of each word in a string.
4800
+ * @param value - The string value.
4801
+ * @returns A FunctionNode representing the INITCAP SQL function.
4802
+ */
4803
+ declare const initcap: (value: OperandInput$5) => FunctionNode;
4804
+ /**
4805
+ * Returns the MD5 hash of a string.
4806
+ * @param value - The string value.
4807
+ * @returns A FunctionNode representing the MD5 SQL function.
4808
+ */
4809
+ declare const md5: (value: OperandInput$5) => FunctionNode;
4810
+ /**
4811
+ * Returns the SHA-1 hash of a string.
4812
+ * @param value - The string value.
4813
+ * @returns A FunctionNode representing the SHA1 SQL function.
4814
+ */
4815
+ declare const sha1: (value: OperandInput$5) => FunctionNode;
4816
+ /**
4817
+ * Returns the SHA-2 hash of a string with a specified bit length.
4818
+ * @param value - The string value.
4819
+ * @param bits - The bit length (e.g., 224, 256, 384, 512).
4820
+ * @returns A FunctionNode representing the SHA2 SQL function.
4821
+ */
4822
+ declare const sha2: (value: OperandInput$5, bits: OperandInput$5) => FunctionNode;
4823
+ /**
4824
+ * Returns the length of a string in bits.
4825
+ * @param value - The string value.
4826
+ * @returns A FunctionNode representing the BIT_LENGTH SQL function.
4827
+ */
4828
+ declare const bitLength: (value: OperandInput$5) => FunctionNode;
4829
+ /**
4830
+ * Returns the length of a string in bytes.
4831
+ * @param value - The string value.
4832
+ * @returns A FunctionNode representing the OCTET_LENGTH SQL function.
4833
+ */
4834
+ declare const octetLength: (value: OperandInput$5) => FunctionNode;
4835
+ /**
4836
+ * Returns a string from an ASCII code.
4837
+ * @param code - The ASCII code.
4838
+ * @returns A FunctionNode representing the CHR/CHAR SQL function.
4839
+ */
4840
+ declare const chr: (code: OperandInput$5) => FunctionNode;
4584
4841
 
4585
- type OperandInput$1 = OperandNode | ColumnDef | string | number | boolean | null;
4842
+ type OperandInput$4 = OperandNode | ColumnDef | string | number | boolean | null;
4586
4843
  /**
4587
4844
  * Returns the absolute value of a number.
4588
4845
  * @param value - The numeric value.
4589
4846
  * @returns A FunctionNode representing the ABS SQL function.
4590
4847
  */
4591
- declare const abs: (value: OperandInput$1) => FunctionNode;
4848
+ declare const abs: (value: OperandInput$4) => FunctionNode;
4592
4849
  /**
4593
4850
  * Returns the arccosine (inverse cosine) of a number.
4594
4851
  * @param value - The numeric value.
4595
4852
  * @returns A FunctionNode representing the ACOS SQL function.
4596
4853
  */
4597
- declare const acos: (value: OperandInput$1) => FunctionNode;
4854
+ declare const acos: (value: OperandInput$4) => FunctionNode;
4598
4855
  /**
4599
4856
  * Returns the arcsine (inverse sine) of a number.
4600
4857
  * @param value - The numeric value.
4601
4858
  * @returns A FunctionNode representing the ASIN SQL function.
4602
4859
  */
4603
- declare const asin: (value: OperandInput$1) => FunctionNode;
4860
+ declare const asin: (value: OperandInput$4) => FunctionNode;
4604
4861
  /**
4605
4862
  * Returns the arctangent (inverse tangent) of a number.
4606
4863
  * @param value - The numeric value.
4607
4864
  * @returns A FunctionNode representing the ATAN SQL function.
4608
4865
  */
4609
- declare const atan: (value: OperandInput$1) => FunctionNode;
4866
+ declare const atan: (value: OperandInput$4) => FunctionNode;
4610
4867
  /**
4611
4868
  * Returns the arctangent of the two arguments.
4612
4869
  * @param y - The y-coordinate.
4613
4870
  * @param x - The x-coordinate.
4614
4871
  * @returns A FunctionNode representing the ATAN2 SQL function.
4615
4872
  */
4616
- declare const atan2: (y: OperandInput$1, x: OperandInput$1) => FunctionNode;
4873
+ declare const atan2: (y: OperandInput$4, x: OperandInput$4) => FunctionNode;
4617
4874
  /**
4618
4875
  * Returns the smallest integer greater than or equal to a number.
4619
4876
  * @param value - The numeric value.
4620
4877
  * @returns A FunctionNode representing the CEIL SQL function.
4621
4878
  */
4622
- declare const ceil: (value: OperandInput$1) => FunctionNode;
4879
+ declare const ceil: (value: OperandInput$4) => FunctionNode;
4623
4880
  /**
4624
4881
  * Alias for ceil. Returns the smallest integer greater than or equal to a number.
4625
4882
  * @param value - The numeric value.
4626
4883
  * @returns A FunctionNode representing the CEILING SQL function.
4627
4884
  */
4628
- declare const ceiling: (value: OperandInput$1) => FunctionNode;
4885
+ declare const ceiling: (value: OperandInput$4) => FunctionNode;
4629
4886
  /**
4630
4887
  * Returns the cosine of a number (in radians).
4631
4888
  * @param value - The numeric value in radians.
4632
4889
  * @returns A FunctionNode representing the COS SQL function.
4633
4890
  */
4634
- declare const cos: (value: OperandInput$1) => FunctionNode;
4891
+ declare const cos: (value: OperandInput$4) => FunctionNode;
4635
4892
  /**
4636
4893
  * Returns the cotangent of a number.
4637
4894
  * @param value - The numeric value.
4638
4895
  * @returns A FunctionNode representing the COT SQL function.
4639
4896
  */
4640
- declare const cot: (value: OperandInput$1) => FunctionNode;
4897
+ declare const cot: (value: OperandInput$4) => FunctionNode;
4641
4898
  /**
4642
4899
  * Converts radians to degrees.
4643
4900
  * @param value - The angle in radians.
4644
4901
  * @returns A FunctionNode representing the DEGREES SQL function.
4645
4902
  */
4646
- declare const degrees: (value: OperandInput$1) => FunctionNode;
4903
+ declare const degrees: (value: OperandInput$4) => FunctionNode;
4647
4904
  /**
4648
4905
  * Returns e raised to the power of the argument.
4649
4906
  * @param value - The exponent.
4650
4907
  * @returns A FunctionNode representing the EXP SQL function.
4651
4908
  */
4652
- declare const exp: (value: OperandInput$1) => FunctionNode;
4909
+ declare const exp: (value: OperandInput$4) => FunctionNode;
4653
4910
  /**
4654
4911
  * Returns the largest integer less than or equal to a number.
4655
4912
  * @param value - The numeric value.
4656
4913
  * @returns A FunctionNode representing the FLOOR SQL function.
4657
4914
  */
4658
- declare const floor: (value: OperandInput$1) => FunctionNode;
4915
+ declare const floor: (value: OperandInput$4) => FunctionNode;
4659
4916
  /**
4660
4917
  * Returns the natural logarithm (base e) of a number.
4661
4918
  * @param value - The numeric value.
4662
4919
  * @returns A FunctionNode representing the LN SQL function.
4663
4920
  */
4664
- declare const ln: (value: OperandInput$1) => FunctionNode;
4921
+ declare const ln: (value: OperandInput$4) => FunctionNode;
4665
4922
  /**
4666
4923
  * Returns the base-10 logarithm of a number.
4667
4924
  * @param value - The numeric value.
4668
4925
  * @returns A FunctionNode representing the LOG SQL function.
4669
4926
  */
4670
- declare const log: (value: OperandInput$1) => FunctionNode;
4927
+ declare const log: (value: OperandInput$4) => FunctionNode;
4671
4928
  /**
4672
4929
  * Returns the base-10 logarithm of a number.
4673
4930
  * @param value - The numeric value.
4674
4931
  * @returns A FunctionNode representing the LOG10 SQL function.
4675
4932
  */
4676
- declare const log10: (value: OperandInput$1) => FunctionNode;
4933
+ declare const log10: (value: OperandInput$4) => FunctionNode;
4677
4934
  /**
4678
4935
  * Returns the logarithm of a number for a specific base.
4679
4936
  * @param base - The base of the logarithm.
4680
4937
  * @param value - The numeric value.
4681
4938
  * @returns A FunctionNode representing the LOG_BASE SQL function.
4682
4939
  */
4683
- declare const logBase: (base: OperandInput$1, value: OperandInput$1) => FunctionNode;
4940
+ declare const logBase: (base: OperandInput$4, value: OperandInput$4) => FunctionNode;
4684
4941
  /**
4685
4942
  * Returns the remainder of dividing x by y.
4686
4943
  * @param x - The dividend.
4687
4944
  * @param y - The divisor.
4688
4945
  * @returns A FunctionNode representing the MOD SQL function.
4689
4946
  */
4690
- declare const mod: (x: OperandInput$1, y: OperandInput$1) => FunctionNode;
4947
+ declare const mod: (x: OperandInput$4, y: OperandInput$4) => FunctionNode;
4691
4948
  /**
4692
4949
  * Returns the value of PI (approximately 3.14159...).
4693
4950
  * @returns A FunctionNode representing the PI SQL function.
@@ -4699,20 +4956,20 @@ declare const pi: () => FunctionNode;
4699
4956
  * @param y - The exponent.
4700
4957
  * @returns A FunctionNode representing the POWER SQL function.
4701
4958
  */
4702
- declare const power: (x: OperandInput$1, y: OperandInput$1) => FunctionNode;
4959
+ declare const power: (x: OperandInput$4, y: OperandInput$4) => FunctionNode;
4703
4960
  /**
4704
4961
  * Alias for power. Returns x raised to the power of y.
4705
4962
  * @param x - The base.
4706
4963
  * @param y - The exponent.
4707
4964
  * @returns A FunctionNode representing the POW SQL function.
4708
4965
  */
4709
- declare const pow: (x: OperandInput$1, y: OperandInput$1) => FunctionNode;
4966
+ declare const pow: (x: OperandInput$4, y: OperandInput$4) => FunctionNode;
4710
4967
  /**
4711
4968
  * Converts degrees to radians.
4712
4969
  * @param value - The angle in degrees.
4713
4970
  * @returns A FunctionNode representing the RADIANS SQL function.
4714
4971
  */
4715
- declare const radians: (value: OperandInput$1) => FunctionNode;
4972
+ declare const radians: (value: OperandInput$4) => FunctionNode;
4716
4973
  /**
4717
4974
  * Returns a random number between 0 and 1.
4718
4975
  * @returns A FunctionNode representing the RANDOM SQL function.
@@ -4729,47 +4986,59 @@ declare const rand: () => FunctionNode;
4729
4986
  * @param decimals - The number of decimal places (optional).
4730
4987
  * @returns A FunctionNode representing the ROUND SQL function.
4731
4988
  */
4732
- declare const round: (value: OperandInput$1, decimals?: OperandInput$1) => FunctionNode;
4989
+ declare const round: (value: OperandInput$4, decimals?: OperandInput$4) => FunctionNode;
4733
4990
  /**
4734
4991
  * Returns the sign of a number (-1 for negative, 0 for zero, 1 for positive).
4735
4992
  * @param value - The numeric value.
4736
4993
  * @returns A FunctionNode representing the SIGN SQL function.
4737
4994
  */
4738
- declare const sign: (value: OperandInput$1) => FunctionNode;
4995
+ declare const sign: (value: OperandInput$4) => FunctionNode;
4739
4996
  /**
4740
4997
  * Returns the sine of a number (in radians).
4741
4998
  * @param value - The numeric value in radians.
4742
4999
  * @returns A FunctionNode representing the SIN SQL function.
4743
5000
  */
4744
- declare const sin: (value: OperandInput$1) => FunctionNode;
5001
+ declare const sin: (value: OperandInput$4) => FunctionNode;
4745
5002
  /**
4746
5003
  * Returns the square root of a number.
4747
5004
  * @param value - The numeric value.
4748
5005
  * @returns A FunctionNode representing the SQRT SQL function.
4749
5006
  */
4750
- declare const sqrt: (value: OperandInput$1) => FunctionNode;
5007
+ declare const sqrt: (value: OperandInput$4) => FunctionNode;
4751
5008
  /**
4752
5009
  * Returns the tangent of a number (in radians).
4753
5010
  * @param value - The numeric value in radians.
4754
5011
  * @returns A FunctionNode representing the TAN SQL function.
4755
5012
  */
4756
- declare const tan: (value: OperandInput$1) => FunctionNode;
5013
+ declare const tan: (value: OperandInput$4) => FunctionNode;
4757
5014
  /**
4758
5015
  * Truncates a number to a specified number of decimal places without rounding.
4759
5016
  * @param value - The numeric value to truncate.
4760
5017
  * @param decimals - The number of decimal places (optional).
4761
5018
  * @returns A FunctionNode representing the TRUNC SQL function.
4762
5019
  */
4763
- declare const trunc: (value: OperandInput$1, decimals?: OperandInput$1) => FunctionNode;
5020
+ declare const trunc: (value: OperandInput$4, decimals?: OperandInput$4) => FunctionNode;
4764
5021
  /**
4765
5022
  * Alias for trunc. Truncates a number to a specified number of decimal places without rounding.
4766
5023
  * @param value - The numeric value to truncate.
4767
5024
  * @param decimals - The number of decimal places.
4768
5025
  * @returns A FunctionNode representing the TRUNCATE SQL function.
4769
5026
  */
4770
- declare const truncate: (value: OperandInput$1, decimals: OperandInput$1) => FunctionNode;
5027
+ declare const truncate: (value: OperandInput$4, decimals: OperandInput$4) => FunctionNode;
5028
+ /**
5029
+ * Returns the base-2 logarithm of a number.
5030
+ * @param value - The numeric value.
5031
+ * @returns A FunctionNode representing the LOG2 SQL function.
5032
+ */
5033
+ declare const log2: (value: OperandInput$4) => FunctionNode;
5034
+ /**
5035
+ * Returns the cube root of a number.
5036
+ * @param value - The numeric value.
5037
+ * @returns A FunctionNode representing the CBRT SQL function.
5038
+ */
5039
+ declare const cbrt: (value: OperandInput$4) => FunctionNode;
4771
5040
 
4772
- type OperandInput = OperandNode | ColumnDef | string | number | boolean | null;
5041
+ type OperandInput$3 = OperandNode | ColumnDef | string | number | boolean | null;
4773
5042
  /**
4774
5043
  * Returns the current local date and time.
4775
5044
  * @returns A FunctionNode representing the NOW() SQL function.
@@ -4790,31 +5059,41 @@ declare const currentTime: () => FunctionNode;
4790
5059
  * @returns A FunctionNode representing the UTC_NOW() SQL function.
4791
5060
  */
4792
5061
  declare const utcNow: () => FunctionNode;
5062
+ /**
5063
+ * Returns the current local time.
5064
+ * @returns A FunctionNode representing the LOCALTIME SQL function.
5065
+ */
5066
+ declare const localTime: () => FunctionNode;
5067
+ /**
5068
+ * Returns the current local timestamp.
5069
+ * @returns A FunctionNode representing the LOCALTIMESTAMP SQL function.
5070
+ */
5071
+ declare const localTimestamp: () => FunctionNode;
4793
5072
  /**
4794
5073
  * Extracts a specified part from a date or datetime value.
4795
5074
  * @param part - The date part to extract (e.g., 'YEAR', 'MONTH', 'DAY', 'HOUR', 'MINUTE', 'SECOND').
4796
5075
  * @param date - The date or datetime value to extract from.
4797
5076
  * @returns A FunctionNode representing the EXTRACT SQL function.
4798
5077
  */
4799
- declare const extract: (part: OperandInput, date: OperandInput) => FunctionNode;
5078
+ declare const extract: (part: OperandInput$3, date: OperandInput$3) => FunctionNode;
4800
5079
  /**
4801
5080
  * Extracts the year from a date or datetime value.
4802
5081
  * @param date - The date or datetime value.
4803
5082
  * @returns A FunctionNode representing the YEAR SQL function.
4804
5083
  */
4805
- declare const year: (date: OperandInput) => FunctionNode;
5084
+ declare const year: (date: OperandInput$3) => FunctionNode;
4806
5085
  /**
4807
5086
  * Extracts the month from a date or datetime value.
4808
5087
  * @param date - The date or datetime value.
4809
5088
  * @returns A FunctionNode representing the MONTH SQL function.
4810
5089
  */
4811
- declare const month: (date: OperandInput) => FunctionNode;
5090
+ declare const month: (date: OperandInput$3) => FunctionNode;
4812
5091
  /**
4813
5092
  * Extracts the day of the month from a date or datetime value.
4814
5093
  * @param date - The date or datetime value.
4815
5094
  * @returns A FunctionNode representing the DAY SQL function.
4816
5095
  */
4817
- declare const day: (date: OperandInput) => FunctionNode;
5096
+ declare const day: (date: OperandInput$3) => FunctionNode;
4818
5097
  /**
4819
5098
  * Adds a specified time interval to a date or datetime value.
4820
5099
  * @param date - The date or datetime value to add to.
@@ -4822,7 +5101,7 @@ declare const day: (date: OperandInput) => FunctionNode;
4822
5101
  * @param unit - The unit type (e.g., 'DAY', 'MONTH', 'YEAR', 'HOUR', 'MINUTE', 'SECOND').
4823
5102
  * @returns A FunctionNode representing the DATE_ADD SQL function.
4824
5103
  */
4825
- declare const dateAdd: (date: OperandInput, interval: OperandInput, unit: OperandInput) => FunctionNode;
5104
+ declare const dateAdd: (date: OperandInput$3, interval: OperandInput$3, unit: OperandInput$3) => FunctionNode;
4826
5105
  /**
4827
5106
  * Subtracts a specified time interval from a date or datetime value.
4828
5107
  * @param date - The date or datetime value to subtract from.
@@ -4830,21 +5109,21 @@ declare const dateAdd: (date: OperandInput, interval: OperandInput, unit: Operan
4830
5109
  * @param unit - The unit type (e.g., 'DAY', 'MONTH', 'YEAR', 'HOUR', 'MINUTE', 'SECOND').
4831
5110
  * @returns A FunctionNode representing the DATE_SUB SQL function.
4832
5111
  */
4833
- declare const dateSub: (date: OperandInput, interval: OperandInput, unit: OperandInput) => FunctionNode;
5112
+ declare const dateSub: (date: OperandInput$3, interval: OperandInput$3, unit: OperandInput$3) => FunctionNode;
4834
5113
  /**
4835
5114
  * Returns the difference between two dates in days.
4836
5115
  * @param date1 - The end date.
4837
5116
  * @param date2 - The start date.
4838
5117
  * @returns A FunctionNode representing the DATE_DIFF SQL function.
4839
5118
  */
4840
- declare const dateDiff: (date1: OperandInput, date2: OperandInput) => FunctionNode;
5119
+ declare const dateDiff: (date1: OperandInput$3, date2: OperandInput$3) => FunctionNode;
4841
5120
  /**
4842
5121
  * Converts a date or datetime value to a formatted string.
4843
5122
  * @param date - The date or datetime value to format.
4844
5123
  * @param format - The format string (dialect-specific).
4845
5124
  * @returns A FunctionNode representing the DATE_FORMAT SQL function.
4846
5125
  */
4847
- declare const dateFormat: (date: OperandInput, format: OperandInput) => FunctionNode;
5126
+ declare const dateFormat: (date: OperandInput$3, format: OperandInput$3) => FunctionNode;
4848
5127
  /**
4849
5128
  * Returns the current Unix timestamp (seconds since 1970-01-01 00:00:00 UTC).
4850
5129
  * @returns A FunctionNode representing the UNIX_TIMESTAMP SQL function.
@@ -4855,32 +5134,106 @@ declare const unixTimestamp: () => FunctionNode;
4855
5134
  * @param timestamp - Unix timestamp in seconds.
4856
5135
  * @returns A FunctionNode representing the FROM_UNIXTIME SQL function.
4857
5136
  */
4858
- declare const fromUnixTime: (timestamp: OperandInput) => FunctionNode;
5137
+ declare const fromUnixTime: (timestamp: OperandInput$3) => FunctionNode;
4859
5138
  /**
4860
5139
  * Returns the last day of the month for a given date.
4861
5140
  * @param date - The date value.
4862
5141
  * @returns A FunctionNode representing the END_OF_MONTH SQL function.
4863
5142
  */
4864
- declare const endOfMonth: (date: OperandInput) => FunctionNode;
5143
+ declare const endOfMonth: (date: OperandInput$3) => FunctionNode;
4865
5144
  /**
4866
5145
  * Returns the index of the weekday for a given date (1 = Sunday, 2 = Monday, etc.).
4867
5146
  * @param date - The date value.
4868
5147
  * @returns A FunctionNode representing the DAY_OF_WEEK SQL function.
4869
5148
  */
4870
- declare const dayOfWeek: (date: OperandInput) => FunctionNode;
5149
+ declare const dayOfWeek: (date: OperandInput$3) => FunctionNode;
4871
5150
  /**
4872
5151
  * Returns the week number of the year for a given date.
4873
5152
  * @param date - The date value.
4874
5153
  * @returns A FunctionNode representing the WEEK_OF_YEAR SQL function.
4875
5154
  */
4876
- declare const weekOfYear: (date: OperandInput) => FunctionNode;
5155
+ declare const weekOfYear: (date: OperandInput$3) => FunctionNode;
4877
5156
  /**
4878
5157
  * Truncates a date or datetime value to a specified precision (e.g., first day of the month/year).
4879
5158
  * @param part - The truncation precision (e.g., 'YEAR', 'MONTH', 'DAY').
4880
5159
  * @param date - The date or datetime value to truncate.
4881
5160
  * @returns A FunctionNode representing the DATE_TRUNC SQL function.
4882
5161
  */
4883
- declare const dateTrunc: (part: OperandInput, date: OperandInput) => FunctionNode;
5162
+ declare const dateTrunc: (part: OperandInput$3, date: OperandInput$3) => FunctionNode;
5163
+ /**
5164
+ * Returns the difference between two timestamps as an interval.
5165
+ * @param timestamp - The end timestamp.
5166
+ * @param baseTimestamp - The start timestamp (optional, defaults to current time).
5167
+ * @returns A FunctionNode representing the AGE SQL function.
5168
+ */
5169
+ declare const age: (timestamp: OperandInput$3, baseTimestamp?: OperandInput$3) => FunctionNode;
5170
+ /**
5171
+ * Extracts the hour from a date or datetime value.
5172
+ * @param date - The date or datetime value.
5173
+ * @returns A FunctionNode representing the HOUR SQL function.
5174
+ */
5175
+ declare const hour: (date: OperandInput$3) => FunctionNode;
5176
+ /**
5177
+ * Extracts the minute from a date or datetime value.
5178
+ * @param date - The date or datetime value.
5179
+ * @returns A FunctionNode representing the MINUTE SQL function.
5180
+ */
5181
+ declare const minute: (date: OperandInput$3) => FunctionNode;
5182
+ /**
5183
+ * Extracts the second from a date or datetime value.
5184
+ * @param date - The date or datetime value.
5185
+ * @returns A FunctionNode representing the SECOND SQL function.
5186
+ */
5187
+ declare const second: (date: OperandInput$3) => FunctionNode;
5188
+ /**
5189
+ * Extracts the quarter from a date or datetime value (1-4).
5190
+ * @param date - The date or datetime value.
5191
+ * @returns A FunctionNode representing the QUARTER SQL function.
5192
+ */
5193
+ declare const quarter: (date: OperandInput$3) => FunctionNode;
5194
+
5195
+ type OperandInput$2 = OperandNode | ColumnDef | string | number | boolean | null;
5196
+ /**
5197
+ * Returns the first non-null value in a list.
5198
+ * @param args - The list of values to check.
5199
+ * @returns A FunctionNode representing the COALESCE SQL function.
5200
+ */
5201
+ declare const coalesce: (...args: OperandInput$2[]) => FunctionNode;
5202
+ /**
5203
+ * Returns null if the two arguments are equal, otherwise returns the first argument.
5204
+ * @param val1 - The first value.
5205
+ * @param val2 - The second value.
5206
+ * @returns A FunctionNode representing the NULLIF SQL function.
5207
+ */
5208
+ declare const nullif: (val1: OperandInput$2, val2: OperandInput$2) => FunctionNode;
5209
+ /**
5210
+ * Returns the largest value in a list.
5211
+ * @param args - The list of values to compare.
5212
+ * @returns A FunctionNode representing the GREATEST SQL function.
5213
+ */
5214
+ declare const greatest: (...args: OperandInput$2[]) => FunctionNode;
5215
+ /**
5216
+ * Returns the smallest value in a list.
5217
+ * @param args - The list of values to compare.
5218
+ * @returns A FunctionNode representing the LEAST SQL function.
5219
+ */
5220
+ declare const least: (...args: OperandInput$2[]) => FunctionNode;
5221
+ /**
5222
+ * Returns the first argument if it is not null, otherwise returns the second argument.
5223
+ * @param val - The value to check.
5224
+ * @param defaultValue - The default value to return if val is null.
5225
+ * @returns A FunctionNode representing the COALESCE SQL function.
5226
+ */
5227
+ declare const ifNull: (val: OperandInput$2, defaultValue: OperandInput$2) => FunctionNode;
5228
+
5229
+ type OperandInput$1 = OperandNode | ColumnDef | string | number | boolean | null;
5230
+ declare const jsonLength: (target: OperandInput$1, path?: OperandInput$1) => FunctionNode;
5231
+ declare const jsonSet: (target: OperandInput$1, path: OperandInput$1, value: OperandInput$1) => FunctionNode;
5232
+ declare const jsonArrayAgg: (value: OperandInput$1) => FunctionNode;
5233
+ declare const jsonContains: (target: OperandInput$1, candidate: OperandInput$1, path?: OperandInput$1) => FunctionNode;
5234
+
5235
+ type OperandInput = OperandNode | ColumnDef | string | number | boolean | null;
5236
+ declare const arrayAppend: (array: OperandInput, value: OperandInput) => FunctionNode;
4884
5237
 
4885
5238
  /**
4886
5239
  * Browser-compatible implementation of AsyncLocalStorage.
@@ -4988,6 +5341,7 @@ declare class TypeScriptGenerator implements ExpressionVisitor<string>, OperandV
4988
5341
  visitCaseExpression(node: CaseExpressionNode): string;
4989
5342
  visitWindowFunction(node: WindowFunctionNode): string;
4990
5343
  visitCast(node: CastExpressionNode): string;
5344
+ visitCollate(node: CollateExpressionNode): string;
4991
5345
  visitAliasRef(node: AliasRefNode): string;
4992
5346
  /**
4993
5347
  * Prints a binary expression to TypeScript code
@@ -5069,6 +5423,7 @@ declare class TypeScriptGenerator implements ExpressionVisitor<string>, OperandV
5069
5423
  */
5070
5424
  private printWindowFunctionOperand;
5071
5425
  private printCastOperand;
5426
+ private printCollateOperand;
5072
5427
  /**
5073
5428
  * Converts method chain lines to inline format
5074
5429
  * @param lines - Method chain lines
@@ -5238,6 +5593,12 @@ declare class DefaultHasManyCollection<TChild> implements HasManyCollection<TChi
5238
5593
  }
5239
5594
 
5240
5595
  type Rows$1 = Record<string, unknown>;
5596
+ /**
5597
+ * Default implementation of a belongs-to reference.
5598
+ * Manages a reference to a parent entity from a child entity through a foreign key.
5599
+ *
5600
+ * @template TParent The type of the parent entity.
5601
+ */
5241
5602
  declare class DefaultBelongsToReference<TParent> implements BelongsToReference<TParent> {
5242
5603
  private readonly ctx;
5243
5604
  private readonly meta;
@@ -5250,6 +5611,17 @@ declare class DefaultBelongsToReference<TParent> implements BelongsToReference<T
5250
5611
  private readonly targetKey;
5251
5612
  private loaded;
5252
5613
  private current;
5614
+ /**
5615
+ * @param ctx The entity context for tracking changes.
5616
+ * @param meta Metadata for the child entity.
5617
+ * @param root The child entity instance (carrying the foreign key).
5618
+ * @param relationName The name of the relation.
5619
+ * @param relation Relation definition.
5620
+ * @param rootTable Table definition of the child entity.
5621
+ * @param loader Function to load the parent entity.
5622
+ * @param createEntity Function to create entity instances from rows.
5623
+ * @param targetKey The primary key of the target (parent) table.
5624
+ */
5253
5625
  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);
5254
5626
  load(): Promise<TParent | null>;
5255
5627
  get(): TParent | null;
@@ -5260,6 +5632,13 @@ declare class DefaultBelongsToReference<TParent> implements BelongsToReference<T
5260
5632
  }
5261
5633
 
5262
5634
  type Rows = Record<string, unknown>[];
5635
+ /**
5636
+ * Default implementation of a many-to-many collection.
5637
+ * Manages the relationship between two entities through a pivot table.
5638
+ * Supports lazy loading, attaching/detaching entities, and syncing by IDs.
5639
+ *
5640
+ * @template TTarget The type of the target entities in the collection.
5641
+ */
5263
5642
  declare class DefaultManyToManyCollection<TTarget> implements ManyToManyCollection<TTarget> {
5264
5643
  private readonly ctx;
5265
5644
  private readonly meta;
@@ -5272,11 +5651,45 @@ declare class DefaultManyToManyCollection<TTarget> implements ManyToManyCollecti
5272
5651
  private readonly localKey;
5273
5652
  private loaded;
5274
5653
  private items;
5654
+ /**
5655
+ * @param ctx The entity context for tracking changes.
5656
+ * @param meta Metadata for the root entity.
5657
+ * @param root The root entity instance.
5658
+ * @param relationName The name of the relation.
5659
+ * @param relation Relation definition.
5660
+ * @param rootTable Table definition of the root entity.
5661
+ * @param loader Function to load the collection items.
5662
+ * @param createEntity Function to create entity instances from rows.
5663
+ * @param localKey The local key used for joining.
5664
+ */
5275
5665
  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);
5666
+ /**
5667
+ * Loads the collection items if not already loaded.
5668
+ * @returns A promise that resolves to the array of target entities.
5669
+ */
5276
5670
  load(): Promise<TTarget[]>;
5671
+ /**
5672
+ * Returns the currently loaded items.
5673
+ * @returns Array of target entities.
5674
+ */
5277
5675
  getItems(): TTarget[];
5676
+ /**
5677
+ * Attaches an entity to the collection.
5678
+ * Registers an 'attach' change in the entity context.
5679
+ * @param target Entity instance or its primary key value.
5680
+ */
5278
5681
  attach(target: TTarget | number | string): void;
5682
+ /**
5683
+ * Detaches an entity from the collection.
5684
+ * Registers a 'detach' change in the entity context.
5685
+ * @param target Entity instance or its primary key value.
5686
+ */
5279
5687
  detach(target: TTarget | number | string): void;
5688
+ /**
5689
+ * Syncs the collection with a list of IDs.
5690
+ * Attaches missing IDs and detaches IDs not in the list.
5691
+ * @param ids Array of primary key values to sync with.
5692
+ */
5280
5693
  syncByIds(ids: (number | string)[]): Promise<void>;
5281
5694
  private ensureEntity;
5282
5695
  private extractId;
@@ -5343,6 +5756,26 @@ interface DualModeClassDecorator {
5343
5756
  <TFunction extends Function>(value: TFunction): void | TFunction;
5344
5757
  <TFunction extends Function>(value: TFunction, context: StandardDecoratorContext): void | TFunction;
5345
5758
  }
5759
+ /**
5760
+ * Bag for storing decorator metadata during the decoration phase.
5761
+ */
5762
+ interface DecoratorMetadataBag {
5763
+ columns: Array<{
5764
+ propertyName: string;
5765
+ column: ColumnDefLike;
5766
+ }>;
5767
+ relations: Array<{
5768
+ propertyName: string;
5769
+ relation: RelationMetadata;
5770
+ }>;
5771
+ }
5772
+ /**
5773
+ * Public helper to read decorator metadata from a class constructor.
5774
+ * Standard decorators only; legacy metadata is intentionally ignored.
5775
+ * @param ctor - The entity constructor.
5776
+ * @returns The metadata bag if present.
5777
+ */
5778
+ declare const getDecoratorMetadata: (ctor: object) => DecoratorMetadataBag | undefined;
5346
5779
 
5347
5780
  /**
5348
5781
  * Options for defining an entity.
@@ -5532,6 +5965,11 @@ interface PostgresClientLike {
5532
5965
  rows: Array<Record<string, unknown>>;
5533
5966
  }>;
5534
5967
  }
5968
+ /**
5969
+ * Creates a database executor for PostgreSQL.
5970
+ * @param client A PostgreSQL client or pool instance.
5971
+ * @returns A DbExecutor implementation for Postgres.
5972
+ */
5535
5973
  declare function createPostgresExecutor(client: PostgresClientLike): DbExecutor;
5536
5974
 
5537
5975
  interface MysqlClientLike {
@@ -5540,6 +5978,11 @@ interface MysqlClientLike {
5540
5978
  commit?(): Promise<void>;
5541
5979
  rollback?(): Promise<void>;
5542
5980
  }
5981
+ /**
5982
+ * Creates a database executor for MySQL.
5983
+ * @param client A MySQL client instance.
5984
+ * @returns A DbExecutor implementation for MySQL.
5985
+ */
5543
5986
  declare function createMysqlExecutor(client: MysqlClientLike): DbExecutor;
5544
5987
 
5545
5988
  interface SqliteClientLike {
@@ -5549,6 +5992,11 @@ interface SqliteClientLike {
5549
5992
  commitTransaction?(): Promise<void>;
5550
5993
  rollbackTransaction?(): Promise<void>;
5551
5994
  }
5995
+ /**
5996
+ * Creates a database executor for SQLite.
5997
+ * @param client A SQLite client instance.
5998
+ * @returns A DbExecutor implementation for SQLite.
5999
+ */
5552
6000
  declare function createSqliteExecutor(client: SqliteClientLike): DbExecutor;
5553
6001
 
5554
6002
  interface MssqlClientLike {
@@ -5559,6 +6007,11 @@ interface MssqlClientLike {
5559
6007
  commit?(): Promise<void>;
5560
6008
  rollback?(): Promise<void>;
5561
6009
  }
6010
+ /**
6011
+ * Creates a database executor for Microsoft SQL Server.
6012
+ * @param client A SQL Server client instance.
6013
+ * @returns A DbExecutor implementation for MSSQL.
6014
+ */
5562
6015
  declare function createMssqlExecutor(client: MssqlClientLike): DbExecutor;
5563
6016
  interface TediousColumn {
5564
6017
  metadata: {
@@ -5618,4 +6071,4 @@ type PooledExecutorFactoryOptions<TConn> = {
5618
6071
  */
5619
6072
  declare function createPooledExecutorFactory<TConn>(opts: PooledExecutorFactoryOptions<TConn>): DbExecutorFactory;
5620
6073
 
5621
- export { type AliasRefNode, type AnyDomainEvent, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToRelation, type BetweenExpressionNode, type BinaryExpressionNode, type CascadeMode, type CaseExpressionNode, type CastExpressionNode, type CheckConstraint, Column, type ColumnDef, type ColumnDiff, type ColumnInput, type ColumnNode, type ColumnOptions, type ColumnRef, type ColumnToTs, type ColumnType, type CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DbExecutor, type DbExecutorFactory, DefaultBelongsToReference, DefaultHasManyCollection, DefaultManyToManyCollection, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, Entity, type EntityContext, type EntityInstance, type EntityOptions, EntityStatus, type ExecutionContext, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, 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 IntrospectOptions, type JsonPathNode, type Jsonify, type JsonifyScalar, type LiteralNode, type LiteralValue, type LogicalExpressionNode, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NullExpressionNode, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SimpleQueryRunner, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, type TrackedEntity, TypeScriptGenerator, UpdateQueryBuilder, type ValueOperandInput, type WindowFunctionNode, abs, acos, add, addDomainEvent, aliasRef, and, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bootstrapEntities, caseWhen, cast, ceil, ceiling, char, charLength, clearExpressionDispatchers, clearOperandDispatchers, col, columnOperand, concat, concatWs, correlateBy, cos, cot, count, countAll, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, defineTable, degrees, denseRank, diffSchema, div, endOfMonth, entityRef, eq, esel, executeHydrated, executeHydratedWithContexts, exists, exp, extract, firstValue, floor, fromUnixTime, generateCreateTableSql, generateSchemaSql, getColumn, getSchemaIntrospector, getTableDefFromEntity, groupConcat, gt, gte, hasMany, hasOne, hydrateRows, inList, inSubquery, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isExpressionSelectionNode, isFunctionNode, isNotNull, isNull, isOperandNode, isValueOperandInput, isWindowFunctionNode, jsonPath, jsonify, lag, lastValue, lead, left, length, like, ln, loadBelongsToManyRelation, loadBelongsToRelation, loadHasManyRelation, loadHasOneRelation, locate, log, log10, logBase, lower, lpad, lt, lte, ltrim, max, min, mod, month, mul, neq, normalizeColumnType, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, or, outerRef, pi, position, pow, power, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, renderColumnDefinition, renderTypeWithArgs, repeat, replace, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, sel, selectFromEntity, sign, sin, space, sqrt, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toTableRef, trim, trunc, truncate, unixTimestamp, upper, utcNow, valueToOperand, visitExpression, visitOperand, weekOfYear, windowFunction, year };
6074
+ export { type AliasRefNode, type AnyDomainEvent, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToRelation, type BetweenExpressionNode, type BinaryExpressionNode, type BitwiseExpressionNode, 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 CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DbExecutor, type DbExecutorFactory, DefaultBelongsToReference, DefaultHasManyCollection, DefaultManyToManyCollection, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, Entity, type EntityContext, type EntityInstance, type EntityOptions, EntityStatus, type ExecutionContext, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, 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 IntrospectOptions, type JsonPathNode, type Jsonify, type JsonifyScalar, type LiteralNode, type LiteralValue, type LogicalExpressionNode, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NullExpressionNode, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SimpleQueryRunner, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, type TrackedEntity, TypeScriptGenerator, UpdateQueryBuilder, type ValueOperandInput, type WindowFunctionNode, abs, acos, add, addDomainEvent, age, aliasRef, and, arrayAppend, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bitAnd, bitLength, bitOr, bitXor, bootstrapEntities, caseWhen, cast, cbrt, ceil, ceiling, char, charLength, chr, clearExpressionDispatchers, clearOperandDispatchers, coalesce, col, collate, columnOperand, concat, concatWs, correlateBy, cos, cot, count, countAll, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, defineTable, degrees, denseRank, diffSchema, div, endOfMonth, entityRef, eq, esel, executeHydrated, executeHydratedWithContexts, exists, exp, extract, firstValue, floor, fromUnixTime, generateCreateTableSql, generateSchemaSql, getColumn, getDecoratorMetadata, getSchemaIntrospector, getTableDefFromEntity, greatest, groupConcat, gt, gte, hasMany, hasOne, hour, hydrateRows, ifNull, inList, inSubquery, initcap, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isCollateExpressionNode, isExpressionSelectionNode, isFunctionNode, isNotNull, isNull, isOperandNode, 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, max, md5, min, minute, mod, month, mul, neq, normalizeColumnType, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, nullif, octetLength, or, outerRef, pi, position, pow, power, quarter, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, renderColumnDefinition, renderTypeWithArgs, repeat, replace, reverse, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, second, sel, selectFromEntity, sha1, sha2, shiftLeft, shiftRight, sign, sin, space, sqrt, stddev, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toTableRef, trim, trunc, truncate, unixTimestamp, upper, utcNow, valueToOperand, variance, visitExpression, visitOperand, weekOfYear, windowFunction, year };