metal-orm 1.0.80 → 1.0.82

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/dist/index.d.cts CHANGED
@@ -656,6 +656,14 @@ interface LiteralNode {
656
656
  /** The literal value (string, number, boolean, Date, or null) */
657
657
  value: string | number | boolean | Date | null;
658
658
  }
659
+ /**
660
+ * AST node representing a named parameter placeholder
661
+ */
662
+ interface ParamNode {
663
+ type: 'Param';
664
+ /** Stable parameter name */
665
+ name: string;
666
+ }
659
667
  /**
660
668
  * AST node representing a reference to a SELECT alias (for ORDER BY / GROUP BY).
661
669
  */
@@ -786,7 +794,7 @@ interface ArithmeticExpressionNode {
786
794
  /**
787
795
  * Union type representing any operand that can be used in expressions
788
796
  */
789
- type OperandNode = AliasRefNode | ColumnNode | LiteralNode | FunctionNode | JsonPathNode | ScalarSubqueryNode | CaseExpressionNode | CastExpressionNode | WindowFunctionNode | ArithmeticExpressionNode | BitwiseExpressionNode | CollateExpressionNode;
797
+ type OperandNode = AliasRefNode | ColumnNode | LiteralNode | ParamNode | FunctionNode | JsonPathNode | ScalarSubqueryNode | CaseExpressionNode | CastExpressionNode | WindowFunctionNode | ArithmeticExpressionNode | BitwiseExpressionNode | CollateExpressionNode;
790
798
  declare const isOperandNode: (node: unknown) => node is OperandNode;
791
799
  declare const isFunctionNode: (node: unknown) => node is FunctionNode;
792
800
  declare const isCaseExpressionNode: (node: unknown) => node is CaseExpressionNode;
@@ -1446,6 +1454,7 @@ interface ExpressionVisitor<R> {
1446
1454
  interface OperandVisitor<R> {
1447
1455
  visitColumn?(node: ColumnNode): R;
1448
1456
  visitLiteral?(node: LiteralNode): R;
1457
+ visitParam?(node: ParamNode): R;
1449
1458
  visitFunction?(node: FunctionNode): R;
1450
1459
  visitJsonPath?(node: JsonPathNode): R;
1451
1460
  visitScalarSubquery?(node: ScalarSubqueryNode): R;
@@ -1486,6 +1495,14 @@ declare const visitExpression: <R>(node: ExpressionNode, visitor: ExpressionVisi
1486
1495
  */
1487
1496
  declare const visitOperand: <R>(node: OperandNode, visitor: OperandVisitor<R>) => R;
1488
1497
 
1498
+ type ParamProxy = ParamNode & {
1499
+ [key: string]: ParamProxy;
1500
+ };
1501
+ type ParamProxyRoot = {
1502
+ [key: string]: ParamProxy;
1503
+ };
1504
+ declare const createParamProxy: () => ParamProxyRoot;
1505
+
1489
1506
  /**
1490
1507
  * Adapts a schema ColumnDef to an AST-friendly ColumnRef.
1491
1508
  */
@@ -2676,6 +2693,7 @@ type NormalizedRelationIncludeTree = Record<string, NormalizedRelationIncludeNod
2676
2693
  type QueryResult = {
2677
2694
  columns: string[];
2678
2695
  values: unknown[][];
2696
+ insertId?: number;
2679
2697
  };
2680
2698
  interface DbExecutor {
2681
2699
  /** Capability flags so the runtime can make correct decisions without relying on optional methods. */
@@ -3229,6 +3247,7 @@ declare class UnitOfWork {
3229
3247
  * @param results - Query results
3230
3248
  */
3231
3249
  private applyReturningResults;
3250
+ private applyInsertId;
3232
3251
  /**
3233
3252
  * Normalizes a column name by removing quotes and table prefixes.
3234
3253
  * @param column - The column name to normalize
@@ -3793,6 +3812,8 @@ interface JsonSchemaProperty {
3793
3812
  format?: JsonSchemaFormat;
3794
3813
  description?: string;
3795
3814
  nullable?: boolean;
3815
+ readOnly?: boolean;
3816
+ writeOnly?: boolean;
3796
3817
  minimum?: number;
3797
3818
  maximum?: number;
3798
3819
  minLength?: number;
@@ -3810,6 +3831,21 @@ interface JsonSchemaProperty {
3810
3831
  oneOf?: JsonSchemaProperty[];
3811
3832
  [key: string]: unknown;
3812
3833
  }
3834
+ /**
3835
+ * OpenAPI 3.1 parameter definition
3836
+ */
3837
+ interface OpenApiParameter {
3838
+ name: string;
3839
+ in: 'query' | 'path' | 'header' | 'cookie';
3840
+ description?: string;
3841
+ required?: boolean;
3842
+ deprecated?: boolean;
3843
+ allowEmptyValue?: boolean;
3844
+ style?: string;
3845
+ explode?: boolean;
3846
+ schema?: JsonSchemaProperty;
3847
+ [key: string]: unknown;
3848
+ }
3813
3849
  /**
3814
3850
  * Complete OpenAPI 3.1 Schema for an entity or query result
3815
3851
  */
@@ -3820,21 +3856,64 @@ interface OpenApiSchema {
3820
3856
  description?: string;
3821
3857
  }
3822
3858
  /**
3823
- * Schema generation options
3859
+ * Column-level schema flags
3824
3860
  */
3825
- interface SchemaOptions {
3826
- /** Use selected columns only (from select/include) vs full entity */
3827
- mode?: 'selected' | 'full';
3861
+ interface ColumnSchemaOptions {
3828
3862
  /** Include description from column comments */
3829
3863
  includeDescriptions?: boolean;
3830
3864
  /** Include enum values for enum columns */
3831
3865
  includeEnums?: boolean;
3832
3866
  /** Include column examples if available */
3833
3867
  includeExamples?: boolean;
3834
- /** Format output for pretty printing (debugging) */
3835
- pretty?: boolean;
3868
+ /** Include column defaults */
3869
+ includeDefaults?: boolean;
3870
+ /** Include nullable flag when applicable */
3871
+ includeNullable?: boolean;
3872
+ }
3873
+ /**
3874
+ * Output schema generation options (query result)
3875
+ */
3876
+ interface OutputSchemaOptions extends ColumnSchemaOptions {
3877
+ /** Use selected columns only (from select/include) vs full entity */
3878
+ mode?: 'selected' | 'full';
3879
+ /** Maximum depth for relation recursion */
3880
+ maxDepth?: number;
3881
+ }
3882
+ type InputRelationMode = 'ids' | 'objects' | 'mixed';
3883
+ type InputSchemaMode = 'create' | 'update';
3884
+ /**
3885
+ * Input schema generation options (write payloads)
3886
+ */
3887
+ interface InputSchemaOptions extends ColumnSchemaOptions {
3888
+ /** Create vs update payload shape */
3889
+ mode?: InputSchemaMode;
3890
+ /** Include relation payloads */
3891
+ includeRelations?: boolean;
3892
+ /** How relations are represented (ids, nested objects, or both) */
3893
+ relationMode?: InputRelationMode;
3836
3894
  /** Maximum depth for relation recursion */
3837
3895
  maxDepth?: number;
3896
+ /** Omit read-only/generated columns from input */
3897
+ omitReadOnly?: boolean;
3898
+ /** Exclude primary key columns from input */
3899
+ excludePrimaryKey?: boolean;
3900
+ /** Require primary key columns on update payloads */
3901
+ requirePrimaryKey?: boolean;
3902
+ }
3903
+ /**
3904
+ * Schema generation options
3905
+ */
3906
+ interface SchemaOptions extends OutputSchemaOptions {
3907
+ /** Input schema options, or false to skip input generation */
3908
+ input?: InputSchemaOptions | false;
3909
+ }
3910
+ /**
3911
+ * Input + output schema bundle
3912
+ */
3913
+ interface OpenApiSchemaBundle {
3914
+ output: OpenApiSchema;
3915
+ input?: OpenApiSchema;
3916
+ parameters?: OpenApiParameter[];
3838
3917
  }
3839
3918
  /**
3840
3919
  * Schema extraction context for handling circular references
@@ -3853,7 +3932,7 @@ interface SchemaExtractionContext {
3853
3932
  /**
3854
3933
  * Maps SQL column types to OpenAPI JSON Schema types
3855
3934
  */
3856
- declare const mapColumnType: (column: ColumnDef) => JsonSchemaProperty;
3935
+ declare const mapColumnType: (column: ColumnDef, options?: ColumnSchemaOptions) => JsonSchemaProperty;
3857
3936
  /**
3858
3937
  * Maps relation type to array or single object
3859
3938
  */
@@ -3867,22 +3946,16 @@ declare const mapRelationType: (relationType: string) => {
3867
3946
  declare const getTemporalFormat: (sqlType: string) => JsonSchemaFormat | undefined;
3868
3947
 
3869
3948
  /**
3870
- * Extracts OpenAPI 3.1 schema from a query builder's hydration plan
3871
- * @param table - Table definition
3872
- * @param plan - Hydration plan from query builder
3873
- * @param projectionNodes - Projection AST nodes (for computed fields)
3874
- * @param options - Schema generation options
3875
- * @returns OpenAPI 3.1 JSON Schema
3949
+ * Extracts OpenAPI 3.1 schemas for output and optional input payloads.
3876
3950
  */
3877
- declare const extractSchema: (table: TableDef, plan: HydrationPlan | undefined, projectionNodes: ProjectionNode[] | undefined, options?: SchemaOptions) => OpenApiSchema;
3951
+ declare const extractSchema: (table: TableDef, plan: HydrationPlan | undefined, projectionNodes: ProjectionNode[] | undefined, options?: SchemaOptions) => OpenApiSchemaBundle;
3878
3952
  /**
3879
3953
  * Converts a schema to a JSON string with optional pretty printing
3880
- * @param schema - OpenAPI schema
3881
- * @param pretty - Whether to pretty print
3882
- * @returns JSON string
3883
3954
  */
3884
3955
  declare const schemaToJson: (schema: OpenApiSchema, pretty?: boolean) => string;
3885
3956
 
3957
+ declare const buildFilterParameters: (table: TableDef, where: ExpressionNode | undefined, from: TableSourceNode | undefined, options?: ColumnSchemaOptions) => OpenApiParameter[];
3958
+
3886
3959
  type SelectDialectInput = Dialect | DialectKey;
3887
3960
 
3888
3961
  type ColumnSelectionValue = ColumnDef | FunctionNode | CaseExpressionNode | WindowFunctionNode | TypedExpression<unknown>;
@@ -4499,14 +4572,14 @@ declare class SelectQueryBuilder<T = EntityInstance<TableDef>, TTable extends Ta
4499
4572
  */
4500
4573
  getHydrationPlan(): HydrationPlan | undefined;
4501
4574
  /**
4502
- * Gets OpenAPI 3.1 JSON Schema for query result
4575
+ * Gets OpenAPI 3.1 JSON Schemas for query output and optional input payloads
4503
4576
  * @param options - Schema generation options
4504
- * @returns OpenAPI 3.1 JSON Schema for query result
4577
+ * @returns OpenAPI 3.1 JSON Schemas for query output and input payloads
4505
4578
  * @example
4506
- * const schema = qb.select('id', 'title', 'author').getSchema();
4507
- * console.log(JSON.stringify(schema, null, 2));
4579
+ * const { output } = qb.select('id', 'title', 'author').getSchema();
4580
+ * console.log(JSON.stringify(output, null, 2));
4508
4581
  */
4509
- getSchema(options?: SchemaOptions): OpenApiSchema;
4582
+ getSchema(options?: SchemaOptions): OpenApiSchemaBundle;
4510
4583
  /**
4511
4584
  * Gets the Abstract Syntax Tree (AST) representation of the query
4512
4585
  * @returns Query AST with hydration applied
@@ -6270,6 +6343,7 @@ declare class TypeScriptGenerator implements ExpressionVisitor<string>, OperandV
6270
6343
  visitArithmeticExpression(arithExpr: ArithmeticExpressionNode): string;
6271
6344
  visitColumn(node: ColumnNode): string;
6272
6345
  visitLiteral(node: LiteralNode): string;
6346
+ visitParam(node: ParamNode): string;
6273
6347
  visitFunction(node: FunctionNode): string;
6274
6348
  visitJsonPath(node: JsonPathNode): string;
6275
6349
  visitScalarSubquery(node: ScalarSubqueryNode): string;
@@ -6327,6 +6401,7 @@ declare class TypeScriptGenerator implements ExpressionVisitor<string>, OperandV
6327
6401
  * @returns TypeScript code representation
6328
6402
  */
6329
6403
  private printLiteralOperand;
6404
+ private printParamOperand;
6330
6405
  /**
6331
6406
  * Prints a function operand to TypeScript code
6332
6407
  * @param fn - Function node
@@ -7131,4 +7206,4 @@ type PooledExecutorFactoryOptions<TConn> = {
7131
7206
  */
7132
7207
  declare function createPooledExecutorFactory<TConn>(opts: PooledExecutorFactoryOptions<TConn>): DbExecutorFactory;
7133
7208
 
7134
- export { type AliasRefNode, type AnyDomainEvent, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToReferenceApi, 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, ConstructorMaterializationStrategy, type CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DbExecutor, type DbExecutorFactory, type DecoratedEntityInstance, DefaultBelongsToReference, DefaultEntityMaterializer, DefaultHasManyCollection, DefaultManyToManyCollection, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, Entity, type EntityContext, type EntityInstance, type EntityMaterializationStrategy, type EntityMaterializer, type EntityOptions, type PrimaryKey$1 as EntityPrimaryKey, 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 HasOneReferenceApi, type HasOneRelation, type HydrationContext, type HydrationMetadata, type HydrationPivotPlan, type HydrationPlan, type HydrationRelationPlan, type InExpressionNode, type InExpressionRight, type IndexColumn, type IndexDef, type InferRow, type InitialHandlers, InsertQueryBuilder, InterceptorPipeline, type IntrospectOptions, type JsonPathNode, type JsonSchemaFormat, type JsonSchemaProperty, type JsonSchemaType, type Jsonify, type JsonifyScalar, type LiteralNode, type LiteralValue, type LogicalExpressionNode, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NullExpressionNode, type OpenApiSchema, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, type PaginatedResult, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type Primitive, PrototypeMaterializationStrategy, type QueryContext, type QueryInterceptor, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey$1 as RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type SaveGraphSessionOptions, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaExtractionContext, type SchemaGenerateResult, type SchemaIntrospector, type SchemaOptions, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SelectableKeys, 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, type TypedExpression, type TypedLike, UpdateQueryBuilder, type ValueOperandInput, type WindowFunctionNode, abs, acos, add, addDomainEvent, age, aliasRef, and, arrayAppend, asType, 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, deleteFrom, denseRank, diffSchema, div, endOfMonth, entityRef, entityRefs, eq, esel, executeHydrated, executeHydratedPlain, executeHydratedPlainWithContexts, executeHydratedWithContexts, executeSchemaSql, executeSchemaSqlFor, exists, exp, extract, extractSchema, firstValue, floor, fromUnixTime, generateCreateTableSql, generateSchemaSql, generateSchemaSqlFor, getColumn, getDecoratorMetadata, getSchemaIntrospector, getTableDefFromEntity, getTemporalFormat, greatest, groupConcat, gt, gte, hasMany, hasOne, hour, hydrateRows, ifNull, inList, inSubquery, initcap, insertInto, 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, mapColumnType, mapRelationType, materializeAs, 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, relationLoaderCache, renderColumnDefinition, renderTypeWithArgs, repeat, replace, reverse, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, schemaToJson, second, sel, selectFrom, selectFromEntity, setRelations, sha1, sha2, shiftLeft, shiftRight, sign, sin, space, sqrt, stddev, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toTableRef, trim, trunc, truncate, unixTimestamp, update, upper, utcNow, valueToOperand, variance, visitExpression, visitOperand, weekOfYear, windowFunction, year };
7209
+ export { type AliasRefNode, type AnyDomainEvent, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToReferenceApi, 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 ColumnSchemaOptions, type ColumnToTs, type ColumnType, ConstructorMaterializationStrategy, type CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DbExecutor, type DbExecutorFactory, type DecoratedEntityInstance, DefaultBelongsToReference, DefaultEntityMaterializer, DefaultHasManyCollection, DefaultManyToManyCollection, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, Entity, type EntityContext, type EntityInstance, type EntityMaterializationStrategy, type EntityMaterializer, type EntityOptions, type PrimaryKey$1 as EntityPrimaryKey, 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 HasOneReferenceApi, type HasOneRelation, type HydrationContext, type HydrationMetadata, type HydrationPivotPlan, type HydrationPlan, type HydrationRelationPlan, type InExpressionNode, type InExpressionRight, type IndexColumn, type IndexDef, type InferRow, type InitialHandlers, type InputRelationMode, type InputSchemaMode, type InputSchemaOptions, InsertQueryBuilder, InterceptorPipeline, type IntrospectOptions, type JsonPathNode, type JsonSchemaFormat, type JsonSchemaProperty, type JsonSchemaType, type Jsonify, type JsonifyScalar, type LiteralNode, type LiteralValue, type LogicalExpressionNode, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NullExpressionNode, type OpenApiParameter, type OpenApiSchema, type OpenApiSchemaBundle, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, type OutputSchemaOptions, type PaginatedResult, type ParamNode, type ParamProxy, type ParamProxyRoot, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type Primitive, PrototypeMaterializationStrategy, type QueryContext, type QueryInterceptor, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey$1 as RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type SaveGraphSessionOptions, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaExtractionContext, type SchemaGenerateResult, type SchemaIntrospector, type SchemaOptions, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SelectableKeys, 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, type TypedExpression, type TypedLike, UpdateQueryBuilder, type ValueOperandInput, type WindowFunctionNode, abs, acos, add, addDomainEvent, age, aliasRef, and, arrayAppend, asType, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bitAnd, bitLength, bitOr, bitXor, bootstrapEntities, buildFilterParameters, 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, createParamProxy, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, defineTable, degrees, deleteFrom, denseRank, diffSchema, div, endOfMonth, entityRef, entityRefs, eq, esel, executeHydrated, executeHydratedPlain, executeHydratedPlainWithContexts, executeHydratedWithContexts, executeSchemaSql, executeSchemaSqlFor, exists, exp, extract, extractSchema, firstValue, floor, fromUnixTime, generateCreateTableSql, generateSchemaSql, generateSchemaSqlFor, getColumn, getDecoratorMetadata, getSchemaIntrospector, getTableDefFromEntity, getTemporalFormat, greatest, groupConcat, gt, gte, hasMany, hasOne, hour, hydrateRows, ifNull, inList, inSubquery, initcap, insertInto, 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, mapColumnType, mapRelationType, materializeAs, 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, relationLoaderCache, renderColumnDefinition, renderTypeWithArgs, repeat, replace, reverse, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, schemaToJson, second, sel, selectFrom, selectFromEntity, setRelations, sha1, sha2, shiftLeft, shiftRight, sign, sin, space, sqrt, stddev, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toTableRef, trim, trunc, truncate, unixTimestamp, update, upper, utcNow, valueToOperand, variance, visitExpression, visitOperand, weekOfYear, windowFunction, year };
package/dist/index.d.ts CHANGED
@@ -656,6 +656,14 @@ interface LiteralNode {
656
656
  /** The literal value (string, number, boolean, Date, or null) */
657
657
  value: string | number | boolean | Date | null;
658
658
  }
659
+ /**
660
+ * AST node representing a named parameter placeholder
661
+ */
662
+ interface ParamNode {
663
+ type: 'Param';
664
+ /** Stable parameter name */
665
+ name: string;
666
+ }
659
667
  /**
660
668
  * AST node representing a reference to a SELECT alias (for ORDER BY / GROUP BY).
661
669
  */
@@ -786,7 +794,7 @@ interface ArithmeticExpressionNode {
786
794
  /**
787
795
  * Union type representing any operand that can be used in expressions
788
796
  */
789
- type OperandNode = AliasRefNode | ColumnNode | LiteralNode | FunctionNode | JsonPathNode | ScalarSubqueryNode | CaseExpressionNode | CastExpressionNode | WindowFunctionNode | ArithmeticExpressionNode | BitwiseExpressionNode | CollateExpressionNode;
797
+ type OperandNode = AliasRefNode | ColumnNode | LiteralNode | ParamNode | FunctionNode | JsonPathNode | ScalarSubqueryNode | CaseExpressionNode | CastExpressionNode | WindowFunctionNode | ArithmeticExpressionNode | BitwiseExpressionNode | CollateExpressionNode;
790
798
  declare const isOperandNode: (node: unknown) => node is OperandNode;
791
799
  declare const isFunctionNode: (node: unknown) => node is FunctionNode;
792
800
  declare const isCaseExpressionNode: (node: unknown) => node is CaseExpressionNode;
@@ -1446,6 +1454,7 @@ interface ExpressionVisitor<R> {
1446
1454
  interface OperandVisitor<R> {
1447
1455
  visitColumn?(node: ColumnNode): R;
1448
1456
  visitLiteral?(node: LiteralNode): R;
1457
+ visitParam?(node: ParamNode): R;
1449
1458
  visitFunction?(node: FunctionNode): R;
1450
1459
  visitJsonPath?(node: JsonPathNode): R;
1451
1460
  visitScalarSubquery?(node: ScalarSubqueryNode): R;
@@ -1486,6 +1495,14 @@ declare const visitExpression: <R>(node: ExpressionNode, visitor: ExpressionVisi
1486
1495
  */
1487
1496
  declare const visitOperand: <R>(node: OperandNode, visitor: OperandVisitor<R>) => R;
1488
1497
 
1498
+ type ParamProxy = ParamNode & {
1499
+ [key: string]: ParamProxy;
1500
+ };
1501
+ type ParamProxyRoot = {
1502
+ [key: string]: ParamProxy;
1503
+ };
1504
+ declare const createParamProxy: () => ParamProxyRoot;
1505
+
1489
1506
  /**
1490
1507
  * Adapts a schema ColumnDef to an AST-friendly ColumnRef.
1491
1508
  */
@@ -2676,6 +2693,7 @@ type NormalizedRelationIncludeTree = Record<string, NormalizedRelationIncludeNod
2676
2693
  type QueryResult = {
2677
2694
  columns: string[];
2678
2695
  values: unknown[][];
2696
+ insertId?: number;
2679
2697
  };
2680
2698
  interface DbExecutor {
2681
2699
  /** Capability flags so the runtime can make correct decisions without relying on optional methods. */
@@ -3229,6 +3247,7 @@ declare class UnitOfWork {
3229
3247
  * @param results - Query results
3230
3248
  */
3231
3249
  private applyReturningResults;
3250
+ private applyInsertId;
3232
3251
  /**
3233
3252
  * Normalizes a column name by removing quotes and table prefixes.
3234
3253
  * @param column - The column name to normalize
@@ -3793,6 +3812,8 @@ interface JsonSchemaProperty {
3793
3812
  format?: JsonSchemaFormat;
3794
3813
  description?: string;
3795
3814
  nullable?: boolean;
3815
+ readOnly?: boolean;
3816
+ writeOnly?: boolean;
3796
3817
  minimum?: number;
3797
3818
  maximum?: number;
3798
3819
  minLength?: number;
@@ -3810,6 +3831,21 @@ interface JsonSchemaProperty {
3810
3831
  oneOf?: JsonSchemaProperty[];
3811
3832
  [key: string]: unknown;
3812
3833
  }
3834
+ /**
3835
+ * OpenAPI 3.1 parameter definition
3836
+ */
3837
+ interface OpenApiParameter {
3838
+ name: string;
3839
+ in: 'query' | 'path' | 'header' | 'cookie';
3840
+ description?: string;
3841
+ required?: boolean;
3842
+ deprecated?: boolean;
3843
+ allowEmptyValue?: boolean;
3844
+ style?: string;
3845
+ explode?: boolean;
3846
+ schema?: JsonSchemaProperty;
3847
+ [key: string]: unknown;
3848
+ }
3813
3849
  /**
3814
3850
  * Complete OpenAPI 3.1 Schema for an entity or query result
3815
3851
  */
@@ -3820,21 +3856,64 @@ interface OpenApiSchema {
3820
3856
  description?: string;
3821
3857
  }
3822
3858
  /**
3823
- * Schema generation options
3859
+ * Column-level schema flags
3824
3860
  */
3825
- interface SchemaOptions {
3826
- /** Use selected columns only (from select/include) vs full entity */
3827
- mode?: 'selected' | 'full';
3861
+ interface ColumnSchemaOptions {
3828
3862
  /** Include description from column comments */
3829
3863
  includeDescriptions?: boolean;
3830
3864
  /** Include enum values for enum columns */
3831
3865
  includeEnums?: boolean;
3832
3866
  /** Include column examples if available */
3833
3867
  includeExamples?: boolean;
3834
- /** Format output for pretty printing (debugging) */
3835
- pretty?: boolean;
3868
+ /** Include column defaults */
3869
+ includeDefaults?: boolean;
3870
+ /** Include nullable flag when applicable */
3871
+ includeNullable?: boolean;
3872
+ }
3873
+ /**
3874
+ * Output schema generation options (query result)
3875
+ */
3876
+ interface OutputSchemaOptions extends ColumnSchemaOptions {
3877
+ /** Use selected columns only (from select/include) vs full entity */
3878
+ mode?: 'selected' | 'full';
3879
+ /** Maximum depth for relation recursion */
3880
+ maxDepth?: number;
3881
+ }
3882
+ type InputRelationMode = 'ids' | 'objects' | 'mixed';
3883
+ type InputSchemaMode = 'create' | 'update';
3884
+ /**
3885
+ * Input schema generation options (write payloads)
3886
+ */
3887
+ interface InputSchemaOptions extends ColumnSchemaOptions {
3888
+ /** Create vs update payload shape */
3889
+ mode?: InputSchemaMode;
3890
+ /** Include relation payloads */
3891
+ includeRelations?: boolean;
3892
+ /** How relations are represented (ids, nested objects, or both) */
3893
+ relationMode?: InputRelationMode;
3836
3894
  /** Maximum depth for relation recursion */
3837
3895
  maxDepth?: number;
3896
+ /** Omit read-only/generated columns from input */
3897
+ omitReadOnly?: boolean;
3898
+ /** Exclude primary key columns from input */
3899
+ excludePrimaryKey?: boolean;
3900
+ /** Require primary key columns on update payloads */
3901
+ requirePrimaryKey?: boolean;
3902
+ }
3903
+ /**
3904
+ * Schema generation options
3905
+ */
3906
+ interface SchemaOptions extends OutputSchemaOptions {
3907
+ /** Input schema options, or false to skip input generation */
3908
+ input?: InputSchemaOptions | false;
3909
+ }
3910
+ /**
3911
+ * Input + output schema bundle
3912
+ */
3913
+ interface OpenApiSchemaBundle {
3914
+ output: OpenApiSchema;
3915
+ input?: OpenApiSchema;
3916
+ parameters?: OpenApiParameter[];
3838
3917
  }
3839
3918
  /**
3840
3919
  * Schema extraction context for handling circular references
@@ -3853,7 +3932,7 @@ interface SchemaExtractionContext {
3853
3932
  /**
3854
3933
  * Maps SQL column types to OpenAPI JSON Schema types
3855
3934
  */
3856
- declare const mapColumnType: (column: ColumnDef) => JsonSchemaProperty;
3935
+ declare const mapColumnType: (column: ColumnDef, options?: ColumnSchemaOptions) => JsonSchemaProperty;
3857
3936
  /**
3858
3937
  * Maps relation type to array or single object
3859
3938
  */
@@ -3867,22 +3946,16 @@ declare const mapRelationType: (relationType: string) => {
3867
3946
  declare const getTemporalFormat: (sqlType: string) => JsonSchemaFormat | undefined;
3868
3947
 
3869
3948
  /**
3870
- * Extracts OpenAPI 3.1 schema from a query builder's hydration plan
3871
- * @param table - Table definition
3872
- * @param plan - Hydration plan from query builder
3873
- * @param projectionNodes - Projection AST nodes (for computed fields)
3874
- * @param options - Schema generation options
3875
- * @returns OpenAPI 3.1 JSON Schema
3949
+ * Extracts OpenAPI 3.1 schemas for output and optional input payloads.
3876
3950
  */
3877
- declare const extractSchema: (table: TableDef, plan: HydrationPlan | undefined, projectionNodes: ProjectionNode[] | undefined, options?: SchemaOptions) => OpenApiSchema;
3951
+ declare const extractSchema: (table: TableDef, plan: HydrationPlan | undefined, projectionNodes: ProjectionNode[] | undefined, options?: SchemaOptions) => OpenApiSchemaBundle;
3878
3952
  /**
3879
3953
  * Converts a schema to a JSON string with optional pretty printing
3880
- * @param schema - OpenAPI schema
3881
- * @param pretty - Whether to pretty print
3882
- * @returns JSON string
3883
3954
  */
3884
3955
  declare const schemaToJson: (schema: OpenApiSchema, pretty?: boolean) => string;
3885
3956
 
3957
+ declare const buildFilterParameters: (table: TableDef, where: ExpressionNode | undefined, from: TableSourceNode | undefined, options?: ColumnSchemaOptions) => OpenApiParameter[];
3958
+
3886
3959
  type SelectDialectInput = Dialect | DialectKey;
3887
3960
 
3888
3961
  type ColumnSelectionValue = ColumnDef | FunctionNode | CaseExpressionNode | WindowFunctionNode | TypedExpression<unknown>;
@@ -4499,14 +4572,14 @@ declare class SelectQueryBuilder<T = EntityInstance<TableDef>, TTable extends Ta
4499
4572
  */
4500
4573
  getHydrationPlan(): HydrationPlan | undefined;
4501
4574
  /**
4502
- * Gets OpenAPI 3.1 JSON Schema for query result
4575
+ * Gets OpenAPI 3.1 JSON Schemas for query output and optional input payloads
4503
4576
  * @param options - Schema generation options
4504
- * @returns OpenAPI 3.1 JSON Schema for query result
4577
+ * @returns OpenAPI 3.1 JSON Schemas for query output and input payloads
4505
4578
  * @example
4506
- * const schema = qb.select('id', 'title', 'author').getSchema();
4507
- * console.log(JSON.stringify(schema, null, 2));
4579
+ * const { output } = qb.select('id', 'title', 'author').getSchema();
4580
+ * console.log(JSON.stringify(output, null, 2));
4508
4581
  */
4509
- getSchema(options?: SchemaOptions): OpenApiSchema;
4582
+ getSchema(options?: SchemaOptions): OpenApiSchemaBundle;
4510
4583
  /**
4511
4584
  * Gets the Abstract Syntax Tree (AST) representation of the query
4512
4585
  * @returns Query AST with hydration applied
@@ -6270,6 +6343,7 @@ declare class TypeScriptGenerator implements ExpressionVisitor<string>, OperandV
6270
6343
  visitArithmeticExpression(arithExpr: ArithmeticExpressionNode): string;
6271
6344
  visitColumn(node: ColumnNode): string;
6272
6345
  visitLiteral(node: LiteralNode): string;
6346
+ visitParam(node: ParamNode): string;
6273
6347
  visitFunction(node: FunctionNode): string;
6274
6348
  visitJsonPath(node: JsonPathNode): string;
6275
6349
  visitScalarSubquery(node: ScalarSubqueryNode): string;
@@ -6327,6 +6401,7 @@ declare class TypeScriptGenerator implements ExpressionVisitor<string>, OperandV
6327
6401
  * @returns TypeScript code representation
6328
6402
  */
6329
6403
  private printLiteralOperand;
6404
+ private printParamOperand;
6330
6405
  /**
6331
6406
  * Prints a function operand to TypeScript code
6332
6407
  * @param fn - Function node
@@ -7131,4 +7206,4 @@ type PooledExecutorFactoryOptions<TConn> = {
7131
7206
  */
7132
7207
  declare function createPooledExecutorFactory<TConn>(opts: PooledExecutorFactoryOptions<TConn>): DbExecutorFactory;
7133
7208
 
7134
- export { type AliasRefNode, type AnyDomainEvent, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToReferenceApi, 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, ConstructorMaterializationStrategy, type CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DbExecutor, type DbExecutorFactory, type DecoratedEntityInstance, DefaultBelongsToReference, DefaultEntityMaterializer, DefaultHasManyCollection, DefaultManyToManyCollection, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, Entity, type EntityContext, type EntityInstance, type EntityMaterializationStrategy, type EntityMaterializer, type EntityOptions, type PrimaryKey$1 as EntityPrimaryKey, 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 HasOneReferenceApi, type HasOneRelation, type HydrationContext, type HydrationMetadata, type HydrationPivotPlan, type HydrationPlan, type HydrationRelationPlan, type InExpressionNode, type InExpressionRight, type IndexColumn, type IndexDef, type InferRow, type InitialHandlers, InsertQueryBuilder, InterceptorPipeline, type IntrospectOptions, type JsonPathNode, type JsonSchemaFormat, type JsonSchemaProperty, type JsonSchemaType, type Jsonify, type JsonifyScalar, type LiteralNode, type LiteralValue, type LogicalExpressionNode, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NullExpressionNode, type OpenApiSchema, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, type PaginatedResult, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type Primitive, PrototypeMaterializationStrategy, type QueryContext, type QueryInterceptor, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey$1 as RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type SaveGraphSessionOptions, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaExtractionContext, type SchemaGenerateResult, type SchemaIntrospector, type SchemaOptions, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SelectableKeys, 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, type TypedExpression, type TypedLike, UpdateQueryBuilder, type ValueOperandInput, type WindowFunctionNode, abs, acos, add, addDomainEvent, age, aliasRef, and, arrayAppend, asType, 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, deleteFrom, denseRank, diffSchema, div, endOfMonth, entityRef, entityRefs, eq, esel, executeHydrated, executeHydratedPlain, executeHydratedPlainWithContexts, executeHydratedWithContexts, executeSchemaSql, executeSchemaSqlFor, exists, exp, extract, extractSchema, firstValue, floor, fromUnixTime, generateCreateTableSql, generateSchemaSql, generateSchemaSqlFor, getColumn, getDecoratorMetadata, getSchemaIntrospector, getTableDefFromEntity, getTemporalFormat, greatest, groupConcat, gt, gte, hasMany, hasOne, hour, hydrateRows, ifNull, inList, inSubquery, initcap, insertInto, 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, mapColumnType, mapRelationType, materializeAs, 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, relationLoaderCache, renderColumnDefinition, renderTypeWithArgs, repeat, replace, reverse, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, schemaToJson, second, sel, selectFrom, selectFromEntity, setRelations, sha1, sha2, shiftLeft, shiftRight, sign, sin, space, sqrt, stddev, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toTableRef, trim, trunc, truncate, unixTimestamp, update, upper, utcNow, valueToOperand, variance, visitExpression, visitOperand, weekOfYear, windowFunction, year };
7209
+ export { type AliasRefNode, type AnyDomainEvent, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToReferenceApi, 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 ColumnSchemaOptions, type ColumnToTs, type ColumnType, ConstructorMaterializationStrategy, type CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DbExecutor, type DbExecutorFactory, type DecoratedEntityInstance, DefaultBelongsToReference, DefaultEntityMaterializer, DefaultHasManyCollection, DefaultManyToManyCollection, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, Entity, type EntityContext, type EntityInstance, type EntityMaterializationStrategy, type EntityMaterializer, type EntityOptions, type PrimaryKey$1 as EntityPrimaryKey, 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 HasOneReferenceApi, type HasOneRelation, type HydrationContext, type HydrationMetadata, type HydrationPivotPlan, type HydrationPlan, type HydrationRelationPlan, type InExpressionNode, type InExpressionRight, type IndexColumn, type IndexDef, type InferRow, type InitialHandlers, type InputRelationMode, type InputSchemaMode, type InputSchemaOptions, InsertQueryBuilder, InterceptorPipeline, type IntrospectOptions, type JsonPathNode, type JsonSchemaFormat, type JsonSchemaProperty, type JsonSchemaType, type Jsonify, type JsonifyScalar, type LiteralNode, type LiteralValue, type LogicalExpressionNode, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NullExpressionNode, type OpenApiParameter, type OpenApiSchema, type OpenApiSchemaBundle, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, type OutputSchemaOptions, type PaginatedResult, type ParamNode, type ParamProxy, type ParamProxyRoot, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type Primitive, PrototypeMaterializationStrategy, type QueryContext, type QueryInterceptor, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey$1 as RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type SaveGraphSessionOptions, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaExtractionContext, type SchemaGenerateResult, type SchemaIntrospector, type SchemaOptions, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SelectableKeys, 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, type TypedExpression, type TypedLike, UpdateQueryBuilder, type ValueOperandInput, type WindowFunctionNode, abs, acos, add, addDomainEvent, age, aliasRef, and, arrayAppend, asType, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bitAnd, bitLength, bitOr, bitXor, bootstrapEntities, buildFilterParameters, 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, createParamProxy, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, defineTable, degrees, deleteFrom, denseRank, diffSchema, div, endOfMonth, entityRef, entityRefs, eq, esel, executeHydrated, executeHydratedPlain, executeHydratedPlainWithContexts, executeHydratedWithContexts, executeSchemaSql, executeSchemaSqlFor, exists, exp, extract, extractSchema, firstValue, floor, fromUnixTime, generateCreateTableSql, generateSchemaSql, generateSchemaSqlFor, getColumn, getDecoratorMetadata, getSchemaIntrospector, getTableDefFromEntity, getTemporalFormat, greatest, groupConcat, gt, gte, hasMany, hasOne, hour, hydrateRows, ifNull, inList, inSubquery, initcap, insertInto, 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, mapColumnType, mapRelationType, materializeAs, 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, relationLoaderCache, renderColumnDefinition, renderTypeWithArgs, repeat, replace, reverse, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, schemaToJson, second, sel, selectFrom, selectFromEntity, setRelations, sha1, sha2, shiftLeft, shiftRight, sign, sin, space, sqrt, stddev, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toTableRef, trim, trunc, truncate, unixTimestamp, update, upper, utcNow, valueToOperand, variance, visitExpression, visitOperand, weekOfYear, windowFunction, year };