metal-orm 1.0.56 → 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.
- package/README.md +21 -20
- package/dist/index.cjs +821 -112
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +429 -70
- package/dist/index.d.ts +429 -70
- package/dist/index.js +785 -112
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/codegen/naming-strategy.ts +3 -1
- package/src/codegen/typescript.ts +20 -10
- package/src/core/ast/aggregate-functions.ts +14 -0
- package/src/core/ast/builders.ts +38 -20
- package/src/core/ast/expression-builders.ts +70 -2
- package/src/core/ast/expression-nodes.ts +305 -274
- package/src/core/ast/expression-visitor.ts +11 -1
- package/src/core/ast/expression.ts +4 -0
- package/src/core/ast/query.ts +3 -0
- package/src/core/ddl/introspect/catalogs/mysql.ts +5 -0
- package/src/core/ddl/introspect/catalogs/sqlite.ts +3 -0
- package/src/core/ddl/introspect/functions/mssql.ts +13 -0
- package/src/core/ddl/introspect/mssql.ts +4 -0
- package/src/core/ddl/introspect/mysql.ts +4 -0
- package/src/core/ddl/introspect/sqlite.ts +4 -0
- package/src/core/dialect/abstract.ts +552 -531
- package/src/core/dialect/base/function-table-formatter.ts +9 -30
- package/src/core/dialect/base/sql-dialect.ts +24 -0
- package/src/core/dialect/mssql/functions.ts +40 -2
- package/src/core/dialect/mysql/functions.ts +16 -2
- package/src/core/dialect/postgres/functions.ts +66 -2
- package/src/core/dialect/postgres/index.ts +17 -4
- package/src/core/dialect/postgres/table-functions.ts +27 -0
- package/src/core/dialect/sqlite/functions.ts +34 -0
- package/src/core/dialect/sqlite/index.ts +17 -1
- package/src/core/driver/database-driver.ts +9 -1
- package/src/core/driver/mssql-driver.ts +3 -0
- package/src/core/driver/mysql-driver.ts +3 -0
- package/src/core/driver/postgres-driver.ts +3 -0
- package/src/core/driver/sqlite-driver.ts +3 -0
- package/src/core/execution/executors/mssql-executor.ts +5 -0
- package/src/core/execution/executors/mysql-executor.ts +5 -0
- package/src/core/execution/executors/postgres-executor.ts +5 -0
- package/src/core/execution/executors/sqlite-executor.ts +5 -0
- package/src/core/functions/array.ts +26 -0
- package/src/core/functions/control-flow.ts +69 -0
- package/src/core/functions/datetime.ts +50 -0
- package/src/core/functions/definitions/aggregate.ts +16 -0
- package/src/core/functions/definitions/control-flow.ts +24 -0
- package/src/core/functions/definitions/datetime.ts +36 -0
- package/src/core/functions/definitions/helpers.ts +29 -0
- package/src/core/functions/definitions/json.ts +49 -0
- package/src/core/functions/definitions/numeric.ts +55 -0
- package/src/core/functions/definitions/string.ts +43 -0
- package/src/core/functions/function-registry.ts +48 -0
- package/src/core/functions/group-concat-helpers.ts +57 -0
- package/src/core/functions/json.ts +38 -0
- package/src/core/functions/numeric.ts +14 -0
- package/src/core/functions/standard-strategy.ts +86 -115
- package/src/core/functions/standard-table-strategy.ts +13 -0
- package/src/core/functions/table-types.ts +15 -0
- package/src/core/functions/text.ts +57 -0
- package/src/core/sql/sql.ts +59 -38
- package/src/decorators/bootstrap.ts +5 -4
- package/src/index.ts +18 -11
- package/src/orm/hydration-context.ts +10 -0
- package/src/orm/identity-map.ts +19 -0
- package/src/orm/interceptor-pipeline.ts +4 -0
- package/src/orm/relations/belongs-to.ts +17 -0
- package/src/orm/relations/has-one.ts +17 -0
- package/src/orm/relations/many-to-many.ts +41 -0
- package/src/query-builder/select.ts +68 -68
- package/src/schema/table-guards.ts +6 -0
- 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
|
|
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
|
|
@@ -2546,6 +2642,10 @@ interface QueryContext {
|
|
|
2546
2642
|
params: unknown[];
|
|
2547
2643
|
}
|
|
2548
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
|
+
*/
|
|
2549
2649
|
declare class InterceptorPipeline {
|
|
2550
2650
|
private interceptors;
|
|
2551
2651
|
use(interceptor: QueryInterceptor): void;
|
|
@@ -2621,12 +2721,31 @@ declare class Orm<E extends DomainEvent = OrmDomainEvent> {
|
|
|
2621
2721
|
dispose(): Promise<void>;
|
|
2622
2722
|
}
|
|
2623
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
|
+
*/
|
|
2624
2728
|
declare class IdentityMap {
|
|
2625
2729
|
private readonly buckets;
|
|
2626
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
|
+
*/
|
|
2627
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
|
+
*/
|
|
2628
2742
|
register(tracked: TrackedEntity): void;
|
|
2629
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
|
+
*/
|
|
2630
2749
|
getEntitiesForTable(table: TableDef): TrackedEntity[];
|
|
2631
2750
|
clear(): void;
|
|
2632
2751
|
private toIdentityKey;
|
|
@@ -3054,11 +3173,21 @@ interface EntityContext {
|
|
|
3054
3173
|
registerRelationChange(root: unknown, relationKey: RelationKey, rootTable: TableDef, relationName: string, relation: RelationDef, change: RelationChange<unknown>): void;
|
|
3055
3174
|
}
|
|
3056
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
|
+
*/
|
|
3057
3181
|
interface HydrationContext<E extends DomainEvent = AnyDomainEvent> {
|
|
3182
|
+
/** The identity map used to track and reuse entity instances. */
|
|
3058
3183
|
identityMap: IdentityMap;
|
|
3184
|
+
/** The unit of work used to track changes in hydrated entities. */
|
|
3059
3185
|
unitOfWork: UnitOfWork;
|
|
3186
|
+
/** The bus used to dispatch domain events during or after hydration. */
|
|
3060
3187
|
domainEvents: DomainEventBus<E, OrmSession<E>>;
|
|
3188
|
+
/** Processor for handling changes in entity relations during hydration. */
|
|
3061
3189
|
relationChanges: RelationChangeProcessor;
|
|
3190
|
+
/** Context providing access to entity-specific metadata and services. */
|
|
3062
3191
|
entityContext: EntityContext;
|
|
3063
3192
|
}
|
|
3064
3193
|
|
|
@@ -4136,6 +4265,11 @@ interface ReturningStrategy {
|
|
|
4136
4265
|
formatReturningColumns(returning: ColumnNode[], quoteIdentifier: (id: string) => string): string;
|
|
4137
4266
|
}
|
|
4138
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
|
+
*/
|
|
4139
4273
|
declare abstract class SqlDialectBase extends Dialect {
|
|
4140
4274
|
abstract quoteIdentifier(id: string): string;
|
|
4141
4275
|
protected paginationStrategy: PaginationStrategy;
|
|
@@ -4505,75 +4639,75 @@ declare const registerSchemaIntrospector: (dialect: DialectName, introspector: S
|
|
|
4505
4639
|
*/
|
|
4506
4640
|
declare const getSchemaIntrospector: (dialect: DialectName) => SchemaIntrospector | undefined;
|
|
4507
4641
|
|
|
4508
|
-
type OperandInput$
|
|
4642
|
+
type OperandInput$5 = OperandNode | ColumnDef | string | number | boolean | null;
|
|
4509
4643
|
/**
|
|
4510
4644
|
* Converts a string to lowercase.
|
|
4511
4645
|
* @param value - The string value.
|
|
4512
4646
|
* @returns A FunctionNode representing the LOWER SQL function.
|
|
4513
4647
|
*/
|
|
4514
|
-
declare const lower: (value: OperandInput$
|
|
4648
|
+
declare const lower: (value: OperandInput$5) => FunctionNode;
|
|
4515
4649
|
/**
|
|
4516
4650
|
* Converts a string to uppercase.
|
|
4517
4651
|
* @param value - The string value.
|
|
4518
4652
|
* @returns A FunctionNode representing the UPPER SQL function.
|
|
4519
4653
|
*/
|
|
4520
|
-
declare const upper: (value: OperandInput$
|
|
4654
|
+
declare const upper: (value: OperandInput$5) => FunctionNode;
|
|
4521
4655
|
/**
|
|
4522
4656
|
* Returns the ASCII code of the first character of a string.
|
|
4523
4657
|
* @param value - The string value.
|
|
4524
4658
|
* @returns A FunctionNode representing the ASCII SQL function.
|
|
4525
4659
|
*/
|
|
4526
|
-
declare const ascii: (value: OperandInput$
|
|
4660
|
+
declare const ascii: (value: OperandInput$5) => FunctionNode;
|
|
4527
4661
|
/**
|
|
4528
4662
|
* Returns a string from one or more ASCII codes.
|
|
4529
4663
|
* @param codes - The ASCII codes.
|
|
4530
4664
|
* @returns A FunctionNode representing the CHAR SQL function.
|
|
4531
4665
|
*/
|
|
4532
|
-
declare const char: (...codes: OperandInput$
|
|
4666
|
+
declare const char: (...codes: OperandInput$5[]) => FunctionNode;
|
|
4533
4667
|
/**
|
|
4534
4668
|
* Returns the number of characters in a string.
|
|
4535
4669
|
* @param value - The string value.
|
|
4536
4670
|
* @returns A FunctionNode representing the CHAR_LENGTH SQL function.
|
|
4537
4671
|
*/
|
|
4538
|
-
declare const charLength: (value: OperandInput$
|
|
4672
|
+
declare const charLength: (value: OperandInput$5) => FunctionNode;
|
|
4539
4673
|
/**
|
|
4540
4674
|
* Returns the length of a string in bytes or characters.
|
|
4541
4675
|
* @param value - The string value.
|
|
4542
4676
|
* @returns A FunctionNode representing the LENGTH SQL function.
|
|
4543
4677
|
*/
|
|
4544
|
-
declare const length: (value: OperandInput$
|
|
4678
|
+
declare const length: (value: OperandInput$5) => FunctionNode;
|
|
4545
4679
|
/**
|
|
4546
4680
|
* Removes leading and trailing whitespace or specified characters from a string.
|
|
4547
4681
|
* @param value - The string value.
|
|
4548
4682
|
* @param chars - The characters to trim (optional).
|
|
4549
4683
|
* @returns A FunctionNode representing the TRIM SQL function.
|
|
4550
4684
|
*/
|
|
4551
|
-
declare const trim: (value: OperandInput$
|
|
4685
|
+
declare const trim: (value: OperandInput$5, chars?: OperandInput$5) => FunctionNode;
|
|
4552
4686
|
/**
|
|
4553
4687
|
* Removes leading whitespace from a string.
|
|
4554
4688
|
* @param value - The string value.
|
|
4555
4689
|
* @returns A FunctionNode representing the LTRIM SQL function.
|
|
4556
4690
|
*/
|
|
4557
|
-
declare const ltrim: (value: OperandInput$
|
|
4691
|
+
declare const ltrim: (value: OperandInput$5) => FunctionNode;
|
|
4558
4692
|
/**
|
|
4559
4693
|
* Removes trailing whitespace from a string.
|
|
4560
4694
|
* @param value - The string value.
|
|
4561
4695
|
* @returns A FunctionNode representing the RTRIM SQL function.
|
|
4562
4696
|
*/
|
|
4563
|
-
declare const rtrim: (value: OperandInput$
|
|
4697
|
+
declare const rtrim: (value: OperandInput$5) => FunctionNode;
|
|
4564
4698
|
/**
|
|
4565
4699
|
* Concatenates two or more strings.
|
|
4566
4700
|
* @param args - The strings to concatenate.
|
|
4567
4701
|
* @returns A FunctionNode representing the CONCAT SQL function.
|
|
4568
4702
|
*/
|
|
4569
|
-
declare const concat: (...args: OperandInput$
|
|
4703
|
+
declare const concat: (...args: OperandInput$5[]) => FunctionNode;
|
|
4570
4704
|
/**
|
|
4571
4705
|
* Concatenates strings with a separator.
|
|
4572
4706
|
* @param separator - The separator string.
|
|
4573
4707
|
* @param args - The strings to concatenate.
|
|
4574
4708
|
* @returns A FunctionNode representing the CONCAT_WS SQL function.
|
|
4575
4709
|
*/
|
|
4576
|
-
declare const concatWs: (separator: OperandInput$
|
|
4710
|
+
declare const concatWs: (separator: OperandInput$5, ...args: OperandInput$5[]) => FunctionNode;
|
|
4577
4711
|
/**
|
|
4578
4712
|
* Extracts a substring from a string.
|
|
4579
4713
|
* @param value - The string value.
|
|
@@ -4581,35 +4715,35 @@ declare const concatWs: (separator: OperandInput$2, ...args: OperandInput$2[]) =
|
|
|
4581
4715
|
* @param length - The length of the substring (optional).
|
|
4582
4716
|
* @returns A FunctionNode representing the SUBSTR SQL function.
|
|
4583
4717
|
*/
|
|
4584
|
-
declare const substr: (value: OperandInput$
|
|
4718
|
+
declare const substr: (value: OperandInput$5, start: OperandInput$5, length?: OperandInput$5) => FunctionNode;
|
|
4585
4719
|
/**
|
|
4586
4720
|
* Returns the leftmost characters of a string.
|
|
4587
4721
|
* @param value - The string value.
|
|
4588
4722
|
* @param len - The number of characters to return.
|
|
4589
4723
|
* @returns A FunctionNode representing the LEFT SQL function.
|
|
4590
4724
|
*/
|
|
4591
|
-
declare const left: (value: OperandInput$
|
|
4725
|
+
declare const left: (value: OperandInput$5, len: OperandInput$5) => FunctionNode;
|
|
4592
4726
|
/**
|
|
4593
4727
|
* Returns the rightmost characters of a string.
|
|
4594
4728
|
* @param value - The string value.
|
|
4595
4729
|
* @param len - The number of characters to return.
|
|
4596
4730
|
* @returns A FunctionNode representing the RIGHT SQL function.
|
|
4597
4731
|
*/
|
|
4598
|
-
declare const right: (value: OperandInput$
|
|
4732
|
+
declare const right: (value: OperandInput$5, len: OperandInput$5) => FunctionNode;
|
|
4599
4733
|
/**
|
|
4600
4734
|
* Returns the position of a substring in a string.
|
|
4601
4735
|
* @param substring - The substring to search for.
|
|
4602
4736
|
* @param value - The string to search in.
|
|
4603
4737
|
* @returns A FunctionNode representing the POSITION SQL function.
|
|
4604
4738
|
*/
|
|
4605
|
-
declare const position: (substring: OperandInput$
|
|
4739
|
+
declare const position: (substring: OperandInput$5, value: OperandInput$5) => FunctionNode;
|
|
4606
4740
|
/**
|
|
4607
4741
|
* Returns the position of a substring in a string.
|
|
4608
4742
|
* @param value - The string to search in.
|
|
4609
4743
|
* @param substring - The substring to search for.
|
|
4610
4744
|
* @returns A FunctionNode representing the INSTR SQL function.
|
|
4611
4745
|
*/
|
|
4612
|
-
declare const instr: (value: OperandInput$
|
|
4746
|
+
declare const instr: (value: OperandInput$5, substring: OperandInput$5) => FunctionNode;
|
|
4613
4747
|
/**
|
|
4614
4748
|
* Returns the position of a substring in a string, optionally starting from a position.
|
|
4615
4749
|
* @param substring - The substring to search for.
|
|
@@ -4617,7 +4751,7 @@ declare const instr: (value: OperandInput$2, substring: OperandInput$2) => Funct
|
|
|
4617
4751
|
* @param start - The starting position (optional).
|
|
4618
4752
|
* @returns A FunctionNode representing the LOCATE SQL function.
|
|
4619
4753
|
*/
|
|
4620
|
-
declare const locate: (substring: OperandInput$
|
|
4754
|
+
declare const locate: (substring: OperandInput$5, value: OperandInput$5, start?: OperandInput$5) => FunctionNode;
|
|
4621
4755
|
/**
|
|
4622
4756
|
* Replaces occurrences of a substring in a string.
|
|
4623
4757
|
* @param value - The string to search in.
|
|
@@ -4625,14 +4759,14 @@ declare const locate: (substring: OperandInput$2, value: OperandInput$2, start?:
|
|
|
4625
4759
|
* @param replacement - The replacement string.
|
|
4626
4760
|
* @returns A FunctionNode representing the REPLACE SQL function.
|
|
4627
4761
|
*/
|
|
4628
|
-
declare const replace: (value: OperandInput$
|
|
4762
|
+
declare const replace: (value: OperandInput$5, search: OperandInput$5, replacement: OperandInput$5) => FunctionNode;
|
|
4629
4763
|
/**
|
|
4630
4764
|
* Repeats a string a specified number of times.
|
|
4631
4765
|
* @param value - The string to repeat.
|
|
4632
4766
|
* @param count - The number of times to repeat.
|
|
4633
4767
|
* @returns A FunctionNode representing the REPEAT SQL function.
|
|
4634
4768
|
*/
|
|
4635
|
-
declare const repeat: (value: OperandInput$
|
|
4769
|
+
declare const repeat: (value: OperandInput$5, count: OperandInput$5) => FunctionNode;
|
|
4636
4770
|
/**
|
|
4637
4771
|
* Left-pads a string to a certain length with another string.
|
|
4638
4772
|
* @param value - The string to pad.
|
|
@@ -4640,7 +4774,7 @@ declare const repeat: (value: OperandInput$2, count: OperandInput$2) => Function
|
|
|
4640
4774
|
* @param pad - The padding string.
|
|
4641
4775
|
* @returns A FunctionNode representing the LPAD SQL function.
|
|
4642
4776
|
*/
|
|
4643
|
-
declare const lpad: (value: OperandInput$
|
|
4777
|
+
declare const lpad: (value: OperandInput$5, len: OperandInput$5, pad: OperandInput$5) => FunctionNode;
|
|
4644
4778
|
/**
|
|
4645
4779
|
* Right-pads a string to a certain length with another string.
|
|
4646
4780
|
* @param value - The string to pad.
|
|
@@ -4648,120 +4782,169 @@ declare const lpad: (value: OperandInput$2, len: OperandInput$2, pad: OperandInp
|
|
|
4648
4782
|
* @param pad - The padding string.
|
|
4649
4783
|
* @returns A FunctionNode representing the RPAD SQL function.
|
|
4650
4784
|
*/
|
|
4651
|
-
declare const rpad: (value: OperandInput$
|
|
4785
|
+
declare const rpad: (value: OperandInput$5, len: OperandInput$5, pad: OperandInput$5) => FunctionNode;
|
|
4652
4786
|
/**
|
|
4653
4787
|
* Returns a string consisting of a specified number of spaces.
|
|
4654
4788
|
* @param count - The number of spaces.
|
|
4655
4789
|
* @returns A FunctionNode representing the SPACE SQL function.
|
|
4656
4790
|
*/
|
|
4657
|
-
declare const space: (count: OperandInput$
|
|
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;
|
|
4658
4841
|
|
|
4659
|
-
type OperandInput$
|
|
4842
|
+
type OperandInput$4 = OperandNode | ColumnDef | string | number | boolean | null;
|
|
4660
4843
|
/**
|
|
4661
4844
|
* Returns the absolute value of a number.
|
|
4662
4845
|
* @param value - The numeric value.
|
|
4663
4846
|
* @returns A FunctionNode representing the ABS SQL function.
|
|
4664
4847
|
*/
|
|
4665
|
-
declare const abs: (value: OperandInput$
|
|
4848
|
+
declare const abs: (value: OperandInput$4) => FunctionNode;
|
|
4666
4849
|
/**
|
|
4667
4850
|
* Returns the arccosine (inverse cosine) of a number.
|
|
4668
4851
|
* @param value - The numeric value.
|
|
4669
4852
|
* @returns A FunctionNode representing the ACOS SQL function.
|
|
4670
4853
|
*/
|
|
4671
|
-
declare const acos: (value: OperandInput$
|
|
4854
|
+
declare const acos: (value: OperandInput$4) => FunctionNode;
|
|
4672
4855
|
/**
|
|
4673
4856
|
* Returns the arcsine (inverse sine) of a number.
|
|
4674
4857
|
* @param value - The numeric value.
|
|
4675
4858
|
* @returns A FunctionNode representing the ASIN SQL function.
|
|
4676
4859
|
*/
|
|
4677
|
-
declare const asin: (value: OperandInput$
|
|
4860
|
+
declare const asin: (value: OperandInput$4) => FunctionNode;
|
|
4678
4861
|
/**
|
|
4679
4862
|
* Returns the arctangent (inverse tangent) of a number.
|
|
4680
4863
|
* @param value - The numeric value.
|
|
4681
4864
|
* @returns A FunctionNode representing the ATAN SQL function.
|
|
4682
4865
|
*/
|
|
4683
|
-
declare const atan: (value: OperandInput$
|
|
4866
|
+
declare const atan: (value: OperandInput$4) => FunctionNode;
|
|
4684
4867
|
/**
|
|
4685
4868
|
* Returns the arctangent of the two arguments.
|
|
4686
4869
|
* @param y - The y-coordinate.
|
|
4687
4870
|
* @param x - The x-coordinate.
|
|
4688
4871
|
* @returns A FunctionNode representing the ATAN2 SQL function.
|
|
4689
4872
|
*/
|
|
4690
|
-
declare const atan2: (y: OperandInput$
|
|
4873
|
+
declare const atan2: (y: OperandInput$4, x: OperandInput$4) => FunctionNode;
|
|
4691
4874
|
/**
|
|
4692
4875
|
* Returns the smallest integer greater than or equal to a number.
|
|
4693
4876
|
* @param value - The numeric value.
|
|
4694
4877
|
* @returns A FunctionNode representing the CEIL SQL function.
|
|
4695
4878
|
*/
|
|
4696
|
-
declare const ceil: (value: OperandInput$
|
|
4879
|
+
declare const ceil: (value: OperandInput$4) => FunctionNode;
|
|
4697
4880
|
/**
|
|
4698
4881
|
* Alias for ceil. Returns the smallest integer greater than or equal to a number.
|
|
4699
4882
|
* @param value - The numeric value.
|
|
4700
4883
|
* @returns A FunctionNode representing the CEILING SQL function.
|
|
4701
4884
|
*/
|
|
4702
|
-
declare const ceiling: (value: OperandInput$
|
|
4885
|
+
declare const ceiling: (value: OperandInput$4) => FunctionNode;
|
|
4703
4886
|
/**
|
|
4704
4887
|
* Returns the cosine of a number (in radians).
|
|
4705
4888
|
* @param value - The numeric value in radians.
|
|
4706
4889
|
* @returns A FunctionNode representing the COS SQL function.
|
|
4707
4890
|
*/
|
|
4708
|
-
declare const cos: (value: OperandInput$
|
|
4891
|
+
declare const cos: (value: OperandInput$4) => FunctionNode;
|
|
4709
4892
|
/**
|
|
4710
4893
|
* Returns the cotangent of a number.
|
|
4711
4894
|
* @param value - The numeric value.
|
|
4712
4895
|
* @returns A FunctionNode representing the COT SQL function.
|
|
4713
4896
|
*/
|
|
4714
|
-
declare const cot: (value: OperandInput$
|
|
4897
|
+
declare const cot: (value: OperandInput$4) => FunctionNode;
|
|
4715
4898
|
/**
|
|
4716
4899
|
* Converts radians to degrees.
|
|
4717
4900
|
* @param value - The angle in radians.
|
|
4718
4901
|
* @returns A FunctionNode representing the DEGREES SQL function.
|
|
4719
4902
|
*/
|
|
4720
|
-
declare const degrees: (value: OperandInput$
|
|
4903
|
+
declare const degrees: (value: OperandInput$4) => FunctionNode;
|
|
4721
4904
|
/**
|
|
4722
4905
|
* Returns e raised to the power of the argument.
|
|
4723
4906
|
* @param value - The exponent.
|
|
4724
4907
|
* @returns A FunctionNode representing the EXP SQL function.
|
|
4725
4908
|
*/
|
|
4726
|
-
declare const exp: (value: OperandInput$
|
|
4909
|
+
declare const exp: (value: OperandInput$4) => FunctionNode;
|
|
4727
4910
|
/**
|
|
4728
4911
|
* Returns the largest integer less than or equal to a number.
|
|
4729
4912
|
* @param value - The numeric value.
|
|
4730
4913
|
* @returns A FunctionNode representing the FLOOR SQL function.
|
|
4731
4914
|
*/
|
|
4732
|
-
declare const floor: (value: OperandInput$
|
|
4915
|
+
declare const floor: (value: OperandInput$4) => FunctionNode;
|
|
4733
4916
|
/**
|
|
4734
4917
|
* Returns the natural logarithm (base e) of a number.
|
|
4735
4918
|
* @param value - The numeric value.
|
|
4736
4919
|
* @returns A FunctionNode representing the LN SQL function.
|
|
4737
4920
|
*/
|
|
4738
|
-
declare const ln: (value: OperandInput$
|
|
4921
|
+
declare const ln: (value: OperandInput$4) => FunctionNode;
|
|
4739
4922
|
/**
|
|
4740
4923
|
* Returns the base-10 logarithm of a number.
|
|
4741
4924
|
* @param value - The numeric value.
|
|
4742
4925
|
* @returns A FunctionNode representing the LOG SQL function.
|
|
4743
4926
|
*/
|
|
4744
|
-
declare const log: (value: OperandInput$
|
|
4927
|
+
declare const log: (value: OperandInput$4) => FunctionNode;
|
|
4745
4928
|
/**
|
|
4746
4929
|
* Returns the base-10 logarithm of a number.
|
|
4747
4930
|
* @param value - The numeric value.
|
|
4748
4931
|
* @returns A FunctionNode representing the LOG10 SQL function.
|
|
4749
4932
|
*/
|
|
4750
|
-
declare const log10: (value: OperandInput$
|
|
4933
|
+
declare const log10: (value: OperandInput$4) => FunctionNode;
|
|
4751
4934
|
/**
|
|
4752
4935
|
* Returns the logarithm of a number for a specific base.
|
|
4753
4936
|
* @param base - The base of the logarithm.
|
|
4754
4937
|
* @param value - The numeric value.
|
|
4755
4938
|
* @returns A FunctionNode representing the LOG_BASE SQL function.
|
|
4756
4939
|
*/
|
|
4757
|
-
declare const logBase: (base: OperandInput$
|
|
4940
|
+
declare const logBase: (base: OperandInput$4, value: OperandInput$4) => FunctionNode;
|
|
4758
4941
|
/**
|
|
4759
4942
|
* Returns the remainder of dividing x by y.
|
|
4760
4943
|
* @param x - The dividend.
|
|
4761
4944
|
* @param y - The divisor.
|
|
4762
4945
|
* @returns A FunctionNode representing the MOD SQL function.
|
|
4763
4946
|
*/
|
|
4764
|
-
declare const mod: (x: OperandInput$
|
|
4947
|
+
declare const mod: (x: OperandInput$4, y: OperandInput$4) => FunctionNode;
|
|
4765
4948
|
/**
|
|
4766
4949
|
* Returns the value of PI (approximately 3.14159...).
|
|
4767
4950
|
* @returns A FunctionNode representing the PI SQL function.
|
|
@@ -4773,20 +4956,20 @@ declare const pi: () => FunctionNode;
|
|
|
4773
4956
|
* @param y - The exponent.
|
|
4774
4957
|
* @returns A FunctionNode representing the POWER SQL function.
|
|
4775
4958
|
*/
|
|
4776
|
-
declare const power: (x: OperandInput$
|
|
4959
|
+
declare const power: (x: OperandInput$4, y: OperandInput$4) => FunctionNode;
|
|
4777
4960
|
/**
|
|
4778
4961
|
* Alias for power. Returns x raised to the power of y.
|
|
4779
4962
|
* @param x - The base.
|
|
4780
4963
|
* @param y - The exponent.
|
|
4781
4964
|
* @returns A FunctionNode representing the POW SQL function.
|
|
4782
4965
|
*/
|
|
4783
|
-
declare const pow: (x: OperandInput$
|
|
4966
|
+
declare const pow: (x: OperandInput$4, y: OperandInput$4) => FunctionNode;
|
|
4784
4967
|
/**
|
|
4785
4968
|
* Converts degrees to radians.
|
|
4786
4969
|
* @param value - The angle in degrees.
|
|
4787
4970
|
* @returns A FunctionNode representing the RADIANS SQL function.
|
|
4788
4971
|
*/
|
|
4789
|
-
declare const radians: (value: OperandInput$
|
|
4972
|
+
declare const radians: (value: OperandInput$4) => FunctionNode;
|
|
4790
4973
|
/**
|
|
4791
4974
|
* Returns a random number between 0 and 1.
|
|
4792
4975
|
* @returns A FunctionNode representing the RANDOM SQL function.
|
|
@@ -4803,47 +4986,59 @@ declare const rand: () => FunctionNode;
|
|
|
4803
4986
|
* @param decimals - The number of decimal places (optional).
|
|
4804
4987
|
* @returns A FunctionNode representing the ROUND SQL function.
|
|
4805
4988
|
*/
|
|
4806
|
-
declare const round: (value: OperandInput$
|
|
4989
|
+
declare const round: (value: OperandInput$4, decimals?: OperandInput$4) => FunctionNode;
|
|
4807
4990
|
/**
|
|
4808
4991
|
* Returns the sign of a number (-1 for negative, 0 for zero, 1 for positive).
|
|
4809
4992
|
* @param value - The numeric value.
|
|
4810
4993
|
* @returns A FunctionNode representing the SIGN SQL function.
|
|
4811
4994
|
*/
|
|
4812
|
-
declare const sign: (value: OperandInput$
|
|
4995
|
+
declare const sign: (value: OperandInput$4) => FunctionNode;
|
|
4813
4996
|
/**
|
|
4814
4997
|
* Returns the sine of a number (in radians).
|
|
4815
4998
|
* @param value - The numeric value in radians.
|
|
4816
4999
|
* @returns A FunctionNode representing the SIN SQL function.
|
|
4817
5000
|
*/
|
|
4818
|
-
declare const sin: (value: OperandInput$
|
|
5001
|
+
declare const sin: (value: OperandInput$4) => FunctionNode;
|
|
4819
5002
|
/**
|
|
4820
5003
|
* Returns the square root of a number.
|
|
4821
5004
|
* @param value - The numeric value.
|
|
4822
5005
|
* @returns A FunctionNode representing the SQRT SQL function.
|
|
4823
5006
|
*/
|
|
4824
|
-
declare const sqrt: (value: OperandInput$
|
|
5007
|
+
declare const sqrt: (value: OperandInput$4) => FunctionNode;
|
|
4825
5008
|
/**
|
|
4826
5009
|
* Returns the tangent of a number (in radians).
|
|
4827
5010
|
* @param value - The numeric value in radians.
|
|
4828
5011
|
* @returns A FunctionNode representing the TAN SQL function.
|
|
4829
5012
|
*/
|
|
4830
|
-
declare const tan: (value: OperandInput$
|
|
5013
|
+
declare const tan: (value: OperandInput$4) => FunctionNode;
|
|
4831
5014
|
/**
|
|
4832
5015
|
* Truncates a number to a specified number of decimal places without rounding.
|
|
4833
5016
|
* @param value - The numeric value to truncate.
|
|
4834
5017
|
* @param decimals - The number of decimal places (optional).
|
|
4835
5018
|
* @returns A FunctionNode representing the TRUNC SQL function.
|
|
4836
5019
|
*/
|
|
4837
|
-
declare const trunc: (value: OperandInput$
|
|
5020
|
+
declare const trunc: (value: OperandInput$4, decimals?: OperandInput$4) => FunctionNode;
|
|
4838
5021
|
/**
|
|
4839
5022
|
* Alias for trunc. Truncates a number to a specified number of decimal places without rounding.
|
|
4840
5023
|
* @param value - The numeric value to truncate.
|
|
4841
5024
|
* @param decimals - The number of decimal places.
|
|
4842
5025
|
* @returns A FunctionNode representing the TRUNCATE SQL function.
|
|
4843
5026
|
*/
|
|
4844
|
-
declare const truncate: (value: OperandInput$
|
|
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;
|
|
4845
5040
|
|
|
4846
|
-
type OperandInput = OperandNode | ColumnDef | string | number | boolean | null;
|
|
5041
|
+
type OperandInput$3 = OperandNode | ColumnDef | string | number | boolean | null;
|
|
4847
5042
|
/**
|
|
4848
5043
|
* Returns the current local date and time.
|
|
4849
5044
|
* @returns A FunctionNode representing the NOW() SQL function.
|
|
@@ -4864,31 +5059,41 @@ declare const currentTime: () => FunctionNode;
|
|
|
4864
5059
|
* @returns A FunctionNode representing the UTC_NOW() SQL function.
|
|
4865
5060
|
*/
|
|
4866
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;
|
|
4867
5072
|
/**
|
|
4868
5073
|
* Extracts a specified part from a date or datetime value.
|
|
4869
5074
|
* @param part - The date part to extract (e.g., 'YEAR', 'MONTH', 'DAY', 'HOUR', 'MINUTE', 'SECOND').
|
|
4870
5075
|
* @param date - The date or datetime value to extract from.
|
|
4871
5076
|
* @returns A FunctionNode representing the EXTRACT SQL function.
|
|
4872
5077
|
*/
|
|
4873
|
-
declare const extract: (part: OperandInput, date: OperandInput) => FunctionNode;
|
|
5078
|
+
declare const extract: (part: OperandInput$3, date: OperandInput$3) => FunctionNode;
|
|
4874
5079
|
/**
|
|
4875
5080
|
* Extracts the year from a date or datetime value.
|
|
4876
5081
|
* @param date - The date or datetime value.
|
|
4877
5082
|
* @returns A FunctionNode representing the YEAR SQL function.
|
|
4878
5083
|
*/
|
|
4879
|
-
declare const year: (date: OperandInput) => FunctionNode;
|
|
5084
|
+
declare const year: (date: OperandInput$3) => FunctionNode;
|
|
4880
5085
|
/**
|
|
4881
5086
|
* Extracts the month from a date or datetime value.
|
|
4882
5087
|
* @param date - The date or datetime value.
|
|
4883
5088
|
* @returns A FunctionNode representing the MONTH SQL function.
|
|
4884
5089
|
*/
|
|
4885
|
-
declare const month: (date: OperandInput) => FunctionNode;
|
|
5090
|
+
declare const month: (date: OperandInput$3) => FunctionNode;
|
|
4886
5091
|
/**
|
|
4887
5092
|
* Extracts the day of the month from a date or datetime value.
|
|
4888
5093
|
* @param date - The date or datetime value.
|
|
4889
5094
|
* @returns A FunctionNode representing the DAY SQL function.
|
|
4890
5095
|
*/
|
|
4891
|
-
declare const day: (date: OperandInput) => FunctionNode;
|
|
5096
|
+
declare const day: (date: OperandInput$3) => FunctionNode;
|
|
4892
5097
|
/**
|
|
4893
5098
|
* Adds a specified time interval to a date or datetime value.
|
|
4894
5099
|
* @param date - The date or datetime value to add to.
|
|
@@ -4896,7 +5101,7 @@ declare const day: (date: OperandInput) => FunctionNode;
|
|
|
4896
5101
|
* @param unit - The unit type (e.g., 'DAY', 'MONTH', 'YEAR', 'HOUR', 'MINUTE', 'SECOND').
|
|
4897
5102
|
* @returns A FunctionNode representing the DATE_ADD SQL function.
|
|
4898
5103
|
*/
|
|
4899
|
-
declare const dateAdd: (date: OperandInput, interval: OperandInput, unit: OperandInput) => FunctionNode;
|
|
5104
|
+
declare const dateAdd: (date: OperandInput$3, interval: OperandInput$3, unit: OperandInput$3) => FunctionNode;
|
|
4900
5105
|
/**
|
|
4901
5106
|
* Subtracts a specified time interval from a date or datetime value.
|
|
4902
5107
|
* @param date - The date or datetime value to subtract from.
|
|
@@ -4904,21 +5109,21 @@ declare const dateAdd: (date: OperandInput, interval: OperandInput, unit: Operan
|
|
|
4904
5109
|
* @param unit - The unit type (e.g., 'DAY', 'MONTH', 'YEAR', 'HOUR', 'MINUTE', 'SECOND').
|
|
4905
5110
|
* @returns A FunctionNode representing the DATE_SUB SQL function.
|
|
4906
5111
|
*/
|
|
4907
|
-
declare const dateSub: (date: OperandInput, interval: OperandInput, unit: OperandInput) => FunctionNode;
|
|
5112
|
+
declare const dateSub: (date: OperandInput$3, interval: OperandInput$3, unit: OperandInput$3) => FunctionNode;
|
|
4908
5113
|
/**
|
|
4909
5114
|
* Returns the difference between two dates in days.
|
|
4910
5115
|
* @param date1 - The end date.
|
|
4911
5116
|
* @param date2 - The start date.
|
|
4912
5117
|
* @returns A FunctionNode representing the DATE_DIFF SQL function.
|
|
4913
5118
|
*/
|
|
4914
|
-
declare const dateDiff: (date1: OperandInput, date2: OperandInput) => FunctionNode;
|
|
5119
|
+
declare const dateDiff: (date1: OperandInput$3, date2: OperandInput$3) => FunctionNode;
|
|
4915
5120
|
/**
|
|
4916
5121
|
* Converts a date or datetime value to a formatted string.
|
|
4917
5122
|
* @param date - The date or datetime value to format.
|
|
4918
5123
|
* @param format - The format string (dialect-specific).
|
|
4919
5124
|
* @returns A FunctionNode representing the DATE_FORMAT SQL function.
|
|
4920
5125
|
*/
|
|
4921
|
-
declare const dateFormat: (date: OperandInput, format: OperandInput) => FunctionNode;
|
|
5126
|
+
declare const dateFormat: (date: OperandInput$3, format: OperandInput$3) => FunctionNode;
|
|
4922
5127
|
/**
|
|
4923
5128
|
* Returns the current Unix timestamp (seconds since 1970-01-01 00:00:00 UTC).
|
|
4924
5129
|
* @returns A FunctionNode representing the UNIX_TIMESTAMP SQL function.
|
|
@@ -4929,32 +5134,106 @@ declare const unixTimestamp: () => FunctionNode;
|
|
|
4929
5134
|
* @param timestamp - Unix timestamp in seconds.
|
|
4930
5135
|
* @returns A FunctionNode representing the FROM_UNIXTIME SQL function.
|
|
4931
5136
|
*/
|
|
4932
|
-
declare const fromUnixTime: (timestamp: OperandInput) => FunctionNode;
|
|
5137
|
+
declare const fromUnixTime: (timestamp: OperandInput$3) => FunctionNode;
|
|
4933
5138
|
/**
|
|
4934
5139
|
* Returns the last day of the month for a given date.
|
|
4935
5140
|
* @param date - The date value.
|
|
4936
5141
|
* @returns A FunctionNode representing the END_OF_MONTH SQL function.
|
|
4937
5142
|
*/
|
|
4938
|
-
declare const endOfMonth: (date: OperandInput) => FunctionNode;
|
|
5143
|
+
declare const endOfMonth: (date: OperandInput$3) => FunctionNode;
|
|
4939
5144
|
/**
|
|
4940
5145
|
* Returns the index of the weekday for a given date (1 = Sunday, 2 = Monday, etc.).
|
|
4941
5146
|
* @param date - The date value.
|
|
4942
5147
|
* @returns A FunctionNode representing the DAY_OF_WEEK SQL function.
|
|
4943
5148
|
*/
|
|
4944
|
-
declare const dayOfWeek: (date: OperandInput) => FunctionNode;
|
|
5149
|
+
declare const dayOfWeek: (date: OperandInput$3) => FunctionNode;
|
|
4945
5150
|
/**
|
|
4946
5151
|
* Returns the week number of the year for a given date.
|
|
4947
5152
|
* @param date - The date value.
|
|
4948
5153
|
* @returns A FunctionNode representing the WEEK_OF_YEAR SQL function.
|
|
4949
5154
|
*/
|
|
4950
|
-
declare const weekOfYear: (date: OperandInput) => FunctionNode;
|
|
5155
|
+
declare const weekOfYear: (date: OperandInput$3) => FunctionNode;
|
|
4951
5156
|
/**
|
|
4952
5157
|
* Truncates a date or datetime value to a specified precision (e.g., first day of the month/year).
|
|
4953
5158
|
* @param part - The truncation precision (e.g., 'YEAR', 'MONTH', 'DAY').
|
|
4954
5159
|
* @param date - The date or datetime value to truncate.
|
|
4955
5160
|
* @returns A FunctionNode representing the DATE_TRUNC SQL function.
|
|
4956
5161
|
*/
|
|
4957
|
-
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;
|
|
4958
5237
|
|
|
4959
5238
|
/**
|
|
4960
5239
|
* Browser-compatible implementation of AsyncLocalStorage.
|
|
@@ -5062,6 +5341,7 @@ declare class TypeScriptGenerator implements ExpressionVisitor<string>, OperandV
|
|
|
5062
5341
|
visitCaseExpression(node: CaseExpressionNode): string;
|
|
5063
5342
|
visitWindowFunction(node: WindowFunctionNode): string;
|
|
5064
5343
|
visitCast(node: CastExpressionNode): string;
|
|
5344
|
+
visitCollate(node: CollateExpressionNode): string;
|
|
5065
5345
|
visitAliasRef(node: AliasRefNode): string;
|
|
5066
5346
|
/**
|
|
5067
5347
|
* Prints a binary expression to TypeScript code
|
|
@@ -5143,6 +5423,7 @@ declare class TypeScriptGenerator implements ExpressionVisitor<string>, OperandV
|
|
|
5143
5423
|
*/
|
|
5144
5424
|
private printWindowFunctionOperand;
|
|
5145
5425
|
private printCastOperand;
|
|
5426
|
+
private printCollateOperand;
|
|
5146
5427
|
/**
|
|
5147
5428
|
* Converts method chain lines to inline format
|
|
5148
5429
|
* @param lines - Method chain lines
|
|
@@ -5312,6 +5593,12 @@ declare class DefaultHasManyCollection<TChild> implements HasManyCollection<TChi
|
|
|
5312
5593
|
}
|
|
5313
5594
|
|
|
5314
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
|
+
*/
|
|
5315
5602
|
declare class DefaultBelongsToReference<TParent> implements BelongsToReference<TParent> {
|
|
5316
5603
|
private readonly ctx;
|
|
5317
5604
|
private readonly meta;
|
|
@@ -5324,6 +5611,17 @@ declare class DefaultBelongsToReference<TParent> implements BelongsToReference<T
|
|
|
5324
5611
|
private readonly targetKey;
|
|
5325
5612
|
private loaded;
|
|
5326
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
|
+
*/
|
|
5327
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);
|
|
5328
5626
|
load(): Promise<TParent | null>;
|
|
5329
5627
|
get(): TParent | null;
|
|
@@ -5334,6 +5632,13 @@ declare class DefaultBelongsToReference<TParent> implements BelongsToReference<T
|
|
|
5334
5632
|
}
|
|
5335
5633
|
|
|
5336
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
|
+
*/
|
|
5337
5642
|
declare class DefaultManyToManyCollection<TTarget> implements ManyToManyCollection<TTarget> {
|
|
5338
5643
|
private readonly ctx;
|
|
5339
5644
|
private readonly meta;
|
|
@@ -5346,11 +5651,45 @@ declare class DefaultManyToManyCollection<TTarget> implements ManyToManyCollecti
|
|
|
5346
5651
|
private readonly localKey;
|
|
5347
5652
|
private loaded;
|
|
5348
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
|
+
*/
|
|
5349
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
|
+
*/
|
|
5350
5670
|
load(): Promise<TTarget[]>;
|
|
5671
|
+
/**
|
|
5672
|
+
* Returns the currently loaded items.
|
|
5673
|
+
* @returns Array of target entities.
|
|
5674
|
+
*/
|
|
5351
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
|
+
*/
|
|
5352
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
|
+
*/
|
|
5353
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
|
+
*/
|
|
5354
5693
|
syncByIds(ids: (number | string)[]): Promise<void>;
|
|
5355
5694
|
private ensureEntity;
|
|
5356
5695
|
private extractId;
|
|
@@ -5626,6 +5965,11 @@ interface PostgresClientLike {
|
|
|
5626
5965
|
rows: Array<Record<string, unknown>>;
|
|
5627
5966
|
}>;
|
|
5628
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
|
+
*/
|
|
5629
5973
|
declare function createPostgresExecutor(client: PostgresClientLike): DbExecutor;
|
|
5630
5974
|
|
|
5631
5975
|
interface MysqlClientLike {
|
|
@@ -5634,6 +5978,11 @@ interface MysqlClientLike {
|
|
|
5634
5978
|
commit?(): Promise<void>;
|
|
5635
5979
|
rollback?(): Promise<void>;
|
|
5636
5980
|
}
|
|
5981
|
+
/**
|
|
5982
|
+
* Creates a database executor for MySQL.
|
|
5983
|
+
* @param client A MySQL client instance.
|
|
5984
|
+
* @returns A DbExecutor implementation for MySQL.
|
|
5985
|
+
*/
|
|
5637
5986
|
declare function createMysqlExecutor(client: MysqlClientLike): DbExecutor;
|
|
5638
5987
|
|
|
5639
5988
|
interface SqliteClientLike {
|
|
@@ -5643,6 +5992,11 @@ interface SqliteClientLike {
|
|
|
5643
5992
|
commitTransaction?(): Promise<void>;
|
|
5644
5993
|
rollbackTransaction?(): Promise<void>;
|
|
5645
5994
|
}
|
|
5995
|
+
/**
|
|
5996
|
+
* Creates a database executor for SQLite.
|
|
5997
|
+
* @param client A SQLite client instance.
|
|
5998
|
+
* @returns A DbExecutor implementation for SQLite.
|
|
5999
|
+
*/
|
|
5646
6000
|
declare function createSqliteExecutor(client: SqliteClientLike): DbExecutor;
|
|
5647
6001
|
|
|
5648
6002
|
interface MssqlClientLike {
|
|
@@ -5653,6 +6007,11 @@ interface MssqlClientLike {
|
|
|
5653
6007
|
commit?(): Promise<void>;
|
|
5654
6008
|
rollback?(): Promise<void>;
|
|
5655
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
|
+
*/
|
|
5656
6015
|
declare function createMssqlExecutor(client: MssqlClientLike): DbExecutor;
|
|
5657
6016
|
interface TediousColumn {
|
|
5658
6017
|
metadata: {
|
|
@@ -5712,4 +6071,4 @@ type PooledExecutorFactoryOptions<TConn> = {
|
|
|
5712
6071
|
*/
|
|
5713
6072
|
declare function createPooledExecutorFactory<TConn>(opts: PooledExecutorFactoryOptions<TConn>): DbExecutorFactory;
|
|
5714
6073
|
|
|
5715
|
-
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, getDecoratorMetadata, 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 };
|