hysteria-orm 12.0.2 → 12.1.0

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/lib/index.d.ts CHANGED
@@ -1760,6 +1760,12 @@ declare class AstParser {
1760
1760
  private readonly model;
1761
1761
  constructor(model: typeof Model, dbType: SqlDataSourceType);
1762
1762
  parse(nodes: (QueryNode | null)[], startBindingIndex?: number, isNestedCondition?: boolean): AstParserType;
1763
+ /**
1764
+ * @description Renders a single node through its dialect interpreter. Used for
1765
+ * nodes pulled out of the main loop (optimizer hints) whose position is fixed
1766
+ * by the parser rather than by their place in the node list.
1767
+ */
1768
+ private renderNode;
1763
1769
  /**
1764
1770
  * Map the database type to a common type if shares the same driver (e.g. mysql and mariadb)
1765
1771
  */
@@ -2246,6 +2252,33 @@ declare class UpdateNode extends QueryNode {
2246
2252
  constructor(fromNode: FromNode, columns?: string[], values?: (any | RawNode | SqlFuncNode)[], isRawValue?: boolean);
2247
2253
  }
2248
2254
 
2255
+ /**
2256
+ * PostgreSQL / CockroachDB: `-- line` or `/* block *\/`.
2257
+ */
2258
+ type PgComment = `--${string}` | `/*${string}*/`;
2259
+ /**
2260
+ * SQLite: `-- line` or `/* block *\/`.
2261
+ */
2262
+ type SqliteComment = `--${string}` | `/*${string}*/`;
2263
+ /**
2264
+ * SQL Server: `-- line` or `/* block *\/`.
2265
+ */
2266
+ type MssqlComment = `--${string}` | `/*${string}*/`;
2267
+ /**
2268
+ * MySQL / MariaDB: `-- line` (whitespace required after `--`), `# line`,
2269
+ * `/* block *\/` or `/*! executable *\/`.
2270
+ */
2271
+ type MySqlComment = `-- ${string}` | `#${string}` | `/*${string}*/` | `/*!${string}*/`;
2272
+ /**
2273
+ * A native SQL comment literal valid for the given dialect.
2274
+ */
2275
+ type SqlComment<D extends SqlDataSourceType> = D extends "mysql" | "mariadb" ? MySqlComment : D extends "postgres" | "cockroachdb" ? PgComment : D extends "sqlite" ? SqliteComment : D extends "mssql" ? MssqlComment : string;
2276
+ /**
2277
+ * An optimizer hint literal. Only MySQL/MariaDB consume `/*+ ... *\/`; on every
2278
+ * other dialect `hintComment()` is not callable.
2279
+ */
2280
+ type SqlHint<D extends SqlDataSourceType> = D extends "mysql" | "mariadb" ? `/*+${string}*/` : never;
2281
+
2249
2282
  /**
2250
2283
  * @description The most basic class for all models for both SQL and NoSQL databases
2251
2284
  * @internal Not meant to be used outside of the library
@@ -2773,12 +2806,14 @@ type SoftDeleteOptions<T> = {
2773
2806
  interface SubQueryable {
2774
2807
  extractQueryNodes(): QueryNode[];
2775
2808
  }
2776
- declare class QueryBuilder<T extends Model = any, S extends Record<string, any> = Record<string, any>> extends JsonQueryBuilder<T, S> implements SubQueryable {
2809
+ declare class QueryBuilder<T extends Model = any, S extends Record<string, any> = Record<string, any>, D extends SqlDataSourceType = SqlDataSourceType> extends JsonQueryBuilder<T, S> implements SubQueryable {
2777
2810
  model: typeof Model;
2778
2811
  protected astParser: AstParser;
2779
2812
  protected unionNodes: UnionNode[];
2780
2813
  protected withNodes: WithNode[];
2781
2814
  protected lockQueryNodes: LockNode[];
2815
+ protected comments: string[];
2816
+ protected hints: string[];
2782
2817
  protected isNestedCondition: boolean;
2783
2818
  protected _interpreterUtils: InterpreterUtils | null;
2784
2819
  protected get interpreterUtils(): InterpreterUtils;
@@ -2811,10 +2846,10 @@ declare class QueryBuilder<T extends Model = any, S extends Record<string, any>
2811
2846
  * // user type: { userName: any } | null
2812
2847
  * ```
2813
2848
  */
2814
- select<const Columns extends readonly Selectable[]>(...columns: Columns): QueryBuilder<T, ComposeBuildRawSelect<S, Columns>>;
2849
+ select<const Columns extends readonly Selectable[]>(...columns: Columns): QueryBuilder<T, ComposeBuildRawSelect<S, Columns>, D>;
2815
2850
  select<ValueType = any, Alias extends string = string>(cbOrQueryBuilder: ((subQuery: QueryBuilder<T>) => void | SubQueryable) | QueryBuilder<any>, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
2816
2851
  [K in Alias]: ValueType;
2817
- }>>;
2852
+ }>, D>;
2818
2853
  /**
2819
2854
  * @description Adds a raw SELECT statement to the query with type safety.
2820
2855
  * @description Use the generic parameter to specify the type of the selected columns.
@@ -2826,11 +2861,11 @@ declare class QueryBuilder<T extends Model = any, S extends Record<string, any>
2826
2861
  * // result type: { total: number } | null
2827
2862
  * ```
2828
2863
  */
2829
- selectRaw<Added extends Record<string, any> = Record<string, any>>(statement: string): QueryBuilder<T, ComposeRawSelect<S, Added>>;
2864
+ selectRaw<Added extends Record<string, any> = Record<string, any>>(statement: string): QueryBuilder<T, ComposeRawSelect<S, Added>, D>;
2830
2865
  /**
2831
2866
  * @description Clears the SELECT clause and resets type to default
2832
2867
  */
2833
- clearSelect(): QueryBuilder<T, Record<string, any>>;
2868
+ clearSelect(): QueryBuilder<T, Record<string, any>, D>;
2834
2869
  /**
2835
2870
  * @description Selects a SQL function applied to a column with a typed alias.
2836
2871
  * @description Provides intellisense for common SQL functions while accepting any custom function.
@@ -2848,22 +2883,22 @@ declare class QueryBuilder<T extends Model = any, S extends Record<string, any>
2848
2883
  */
2849
2884
  selectFunc<F extends SqlFunction, Alias extends string>(sqlFunc: F, column: string, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
2850
2885
  [K in Alias]: SqlFunctionReturnType<F>;
2851
- }>>;
2886
+ }>, D>;
2852
2887
  selectJson<ValueType = any, Alias extends string = string>(column: ModelKey<T> | string, path: JsonPathInput, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
2853
2888
  [K in Alias]: ValueType;
2854
- }>>;
2889
+ }>, D>;
2855
2890
  selectJsonText<ValueType = string, Alias extends string = string>(column: ModelKey<T> | string, path: JsonPathInput, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
2856
2891
  [K in Alias]: ValueType;
2857
- }>>;
2892
+ }>, D>;
2858
2893
  selectJsonArrayLength<Alias extends string = string>(column: ModelKey<T> | string, path: JsonPathInput, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
2859
2894
  [K in Alias]: number;
2860
- }>>;
2895
+ }>, D>;
2861
2896
  selectJsonKeys<Alias extends string = string>(column: ModelKey<T> | string, path: JsonPathInput, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
2862
2897
  [K in Alias]: string[];
2863
- }>>;
2898
+ }>, D>;
2864
2899
  selectJsonRaw<ValueType = any, Alias extends string = string>(raw: string, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
2865
2900
  [K in Alias]: ValueType;
2866
- }>>;
2901
+ }>, D>;
2867
2902
  /**
2868
2903
  * @description Executes the query and returns true if the query returns at least one result, false otherwise.
2869
2904
  */
@@ -2952,6 +2987,37 @@ declare class QueryBuilder<T extends Model = any, S extends Record<string, any>
2952
2987
  skipLocked?: boolean;
2953
2988
  noWait?: boolean;
2954
2989
  }): this;
2990
+ /**
2991
+ * @description Prepends a native SQL comment to the select statement, in the
2992
+ * syntax of the active dialect (e.g. `-- line`, `/* block *\/`; MySQL adds
2993
+ * `# line` and `/*! executable *\/`). Select-only. Stackable — each call adds
2994
+ * its own comment.
2995
+ * @throws If the value is not a valid comment for the dialect
2996
+ */
2997
+ comment(comment: SqlComment<D>): this;
2998
+ /**
2999
+ * @description Adds an optimizer hint (`/*+ ... *\/`) immediately after the
3000
+ * SELECT keyword, where MySQL/MariaDB read it. Select-only.
3001
+ * @description Only callable when the dialect is MySQL/MariaDB; stackable —
3002
+ * repeated calls join into a single hint comment.
3003
+ * @throws If the value is not a valid optimizer hint
3004
+ */
3005
+ hintComment(hint: SqlHint<D>): this;
3006
+ /**
3007
+ * @description Removes any comment added with `comment()`
3008
+ */
3009
+ clearComment(): this;
3010
+ /**
3011
+ * @description Removes any hint added with `hintComment()`
3012
+ */
3013
+ clearHintComment(): this;
3014
+ /**
3015
+ * @description Comments are interpolated into the SQL verbatim, so a value that
3016
+ * escapes the comment — a newline inside a line comment, or a nested `*\/` in a
3017
+ * block comment — would let the caller inject arbitrary SQL. A `?` is rejected
3018
+ * because the driver reads it as a bind placeholder even inside a comment.
3019
+ */
3020
+ private assertValidSqlComment;
2955
3021
  /**
2956
3022
  * @description Adds a UNION to the query.
2957
3023
  */
@@ -3134,11 +3200,11 @@ declare class QueryBuilder<T extends Model = any, S extends Record<string, any>
3134
3200
  /**
3135
3201
  * @description Returns a deep clone of the query builder instance.
3136
3202
  */
3137
- clone(): QueryBuilder<T, S>;
3203
+ clone(): QueryBuilder<T, S, D>;
3138
3204
  /**
3139
3205
  * @description Gives a fresh instance of the query builder
3140
3206
  */
3141
- clear(): QueryBuilder<T, Record<string, any>>;
3207
+ clear(): QueryBuilder<T, Record<string, any>, D>;
3142
3208
  /**
3143
3209
  * @description Removes the lock query
3144
3210
  */
@@ -3570,7 +3636,7 @@ declare class SqlDataSource<D extends SqlDataSourceType = SqlDataSourceType, T e
3570
3636
  * // rows is typed as Record<string, any>[]
3571
3637
  * ```
3572
3638
  */
3573
- from<S extends string>(table: TableFormat<S>, options?: RawModelOptions): QueryBuilder;
3639
+ from<S extends string>(table: TableFormat<S>, options?: RawModelOptions): QueryBuilder<any, Record<string, any>, D>;
3574
3640
  /**
3575
3641
  * @description Returns a SchemaBuilder instance for DDL operations
3576
3642
  * @description The builder will execute queries when awaited or when .execute() is called
@@ -6426,7 +6492,7 @@ type UpdateOptions = {};
6426
6492
  */
6427
6493
  type RelationQueryBuilderType<T extends Model, A extends Record<string, any> = {}, R extends Record<string, any> = {}> = Omit<ModelQueryBuilder<T, A, R>, "increment" | "decrement" | "paginate" | "pluck" | "truncate" | "many" | "one" | "oneOrFail" | "insert" | "insertMany" | "update" | "delete" | "softDelete" | "getSum" | "getAvg" | "getMin" | "getMax" | "getCount" | "getMin" | "getMax" | "getCount">;
6428
6494
 
6429
- declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> = ModelWithoutRelations<T>, R extends Record<string, any> = {}, D extends SqlDataSourceType = SqlDataSourceType> extends QueryBuilder<T, Record<string, any>> {
6495
+ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> = ModelWithoutRelations<T>, R extends Record<string, any> = {}, D extends SqlDataSourceType = SqlDataSourceType> extends QueryBuilder<T, Record<string, any>, D> {
6430
6496
  relation: Relation;
6431
6497
  protected sqlModelManagerUtils: SqlModelManagerUtils<T>;
6432
6498
  protected relationQueryBuilders: ModelQueryBuilder<any>[];
@@ -6621,11 +6687,11 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
6621
6687
  * const users = await sql.from(users).select("*").many();
6622
6688
  * ```
6623
6689
  */
6624
- select<const Columns extends readonly (ModelKey<T> | `${string}.*` | "*" | readonly [ModelKey<T>, string])[]>(...columns: Columns): ModelQueryBuilder<T, ComposeBuildSelect<S, T, Columns extends readonly (string | readonly [string, string])[] ? Columns : readonly (string | readonly [string, string])[]>, R>;
6625
- select<const Columns extends readonly ModelSelectableInput<T>[]>(...columns: Columns): ModelQueryBuilder<T, ComposeBuildSelect<S, T, Columns extends readonly (string | readonly [string, string])[] ? Columns : readonly (string | readonly [string, string])[]>, R>;
6690
+ select<const Columns extends readonly (ModelKey<T> | `${string}.*` | "*" | readonly [ModelKey<T>, string])[]>(...columns: Columns): ModelQueryBuilder<T, ComposeBuildSelect<S, T, Columns extends readonly (string | readonly [string, string])[] ? Columns : readonly (string | readonly [string, string])[]>, R, D>;
6691
+ select<const Columns extends readonly ModelSelectableInput<T>[]>(...columns: Columns): ModelQueryBuilder<T, ComposeBuildSelect<S, T, Columns extends readonly (string | readonly [string, string])[] ? Columns : readonly (string | readonly [string, string])[]>, R, D>;
6626
6692
  select<ValueType = any, Alias extends string = string>(cbOrQueryBuilder: ((subQuery: QueryBuilder<T>) => void | SubQueryable) | QueryBuilder<any, any>, alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
6627
6693
  [K in Alias]: ValueType;
6628
- }>, R>;
6694
+ }>, R, D>;
6629
6695
  /**
6630
6696
  * @description Adds a raw SELECT statement with type-safe return type.
6631
6697
  * @description Use the generic parameter to specify the type of the selected columns.
@@ -6645,7 +6711,7 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
6645
6711
  * // users[0] is { id: number, total: number }
6646
6712
  * ```
6647
6713
  */
6648
- selectRaw<Added extends Record<string, any> = Record<string, any>>(statement: string): ModelQueryBuilder<T, ComposeSelect<S, Added>, R>;
6714
+ selectRaw<Added extends Record<string, any> = Record<string, any>>(statement: string): ModelQueryBuilder<T, ComposeSelect<S, Added>, R, D>;
6649
6715
  /**
6650
6716
  * @description Selects a SQL function applied to a column with a typed alias.
6651
6717
  * @description Provides intellisense for common SQL functions while accepting any custom function.
@@ -6669,7 +6735,7 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
6669
6735
  */
6670
6736
  selectFunc<F extends SqlFunction, Alias extends string>(sqlFunc: F, column: ModelKey<T> | "*" | (string & {}), alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
6671
6737
  [K in Alias]: SqlFunctionReturnType<F>;
6672
- }>, R>;
6738
+ }>, R, D>;
6673
6739
  /**
6674
6740
  * @description Clears the SELECT clause and resets to default model type
6675
6741
  * @example
@@ -6680,7 +6746,7 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
6680
6746
  * .many();
6681
6747
  * ```
6682
6748
  */
6683
- clearSelect(): ModelQueryBuilder<T, ModelWithoutRelations<T>, R>;
6749
+ clearSelect(): ModelQueryBuilder<T, ModelWithoutRelations<T>, R, D>;
6684
6750
  /**
6685
6751
  * @description Selects a JSON value at the specified path and returns it as JSON.
6686
6752
  * @param column - The column containing JSON data. Accepts model column names (with IDE autocompletion)
@@ -6721,7 +6787,7 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
6721
6787
  */
6722
6788
  selectJson<K extends ModelKey<T> | (string & {}), P extends [K] extends [ModelKey<T>] ? TypedJsonPathInput<ResolveColumnType<T, K & string>> : JsonPathInput, Alias extends string = string>(column: K, path: P, alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
6723
6789
  [Q in Alias]: [K] extends [ModelKey<T>] ? P extends string ? ResolveJsonPathType<NonNullable<ResolveColumnType<T, K & string>>, P> extends infer R ? unknown extends R ? any : R : any : any : any;
6724
- }>, R>;
6790
+ }>, R, D>;
6725
6791
  /**
6726
6792
  * @description Selects a JSON value at the specified path and returns it as text.
6727
6793
  * @param column - The column containing JSON data. Accepts model column names (with IDE autocompletion)
@@ -6759,7 +6825,7 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
6759
6825
  */
6760
6826
  selectJsonText<K extends ModelKey<T> | (string & {}), ValueType = string, Alias extends string = string>(column: K, path: K extends ModelKey<T> ? TypedJsonPathInput<ResolveColumnType<T, K & string>> : JsonPathInput, alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
6761
6827
  [P in Alias]: ValueType;
6762
- }>, R>;
6828
+ }>, R, D>;
6763
6829
  /**
6764
6830
  * @description Selects the length of a JSON array at the specified path.
6765
6831
  * @param column - The column containing JSON array data. Accepts model column names (with IDE autocompletion)
@@ -6801,7 +6867,7 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
6801
6867
  */
6802
6868
  selectJsonArrayLength<K extends ModelKey<T> | (string & {}), ValueType = number, Alias extends string = string>(column: K, path: K extends ModelKey<T> ? TypedJsonPathInput<ResolveColumnType<T, K & string>> : JsonPathInput, alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
6803
6869
  [P in Alias]: ValueType;
6804
- }>, R>;
6870
+ }>, R, D>;
6805
6871
  /**
6806
6872
  * @description Selects the keys of a JSON object at the specified path.
6807
6873
  * @param column - The column containing JSON object data. Accepts model column names (with IDE autocompletion)
@@ -6845,7 +6911,7 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
6845
6911
  */
6846
6912
  selectJsonKeys<K extends ModelKey<T> | (string & {}), ValueType = string[], Alias extends string = string>(column: K, path: K extends ModelKey<T> ? TypedJsonPathInput<ResolveColumnType<T, K & string>> : JsonPathInput, alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
6847
6913
  [P in Alias]: ValueType;
6848
- }>, R>;
6914
+ }>, R, D>;
6849
6915
  /**
6850
6916
  * @description Adds a raw JSON select expression using database-specific SQL syntax.
6851
6917
  * @param raw - The raw SQL expression (database-specific syntax). Bypasses path standardization —
@@ -6885,7 +6951,7 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
6885
6951
  */
6886
6952
  selectJsonRaw<ValueType = any, Alias extends string = string>(raw: string, alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
6887
6953
  [K in Alias]: ValueType;
6888
- }>, R>;
6954
+ }>, R, D>;
6889
6955
  /**
6890
6956
  * @description Fills the relations in the model in the serialized response. Relation must be defined with `definerelations` and passed in the `createSchema` function inside the SqlDataSource.
6891
6957
  * @warning Many to many relations have special behavior, since they require a join, a join clause will always be added to the query.
@@ -6912,22 +6978,22 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
6912
6978
  */
6913
6979
  load<RelationKey extends ModelRelation<T>>(relation: RelationKey): ModelQueryBuilder<T, S, R & {
6914
6980
  [K in RelationKey]: Awaited<ReturnType<ModelQueryBuilder<RelatedInstance<T, K>, ModelWithoutRelations<RelatedInstance<T, K>>, {}>[RelationRetrieveMethod<T[K]>]>>;
6915
- }>;
6981
+ }, D>;
6916
6982
  load<RelationKey extends ModelRelation<T>, IS extends Record<string, any> = ModelWithoutRelations<RelatedInstance<T, RelationKey>>, IR extends Record<string, any> = {}>(relation: RelationKey, queryBuilder: (queryBuilder: RelationQueryBuilderType<RelatedInstance<T, RelationKey>, ModelWithoutRelations<RelatedInstance<T, RelationKey>>, {}>) => RelationQueryBuilderType<RelatedInstance<T, RelationKey>, IS, IR>): ModelQueryBuilder<T, S, R & {
6917
6983
  [K in RelationKey]: Awaited<ReturnType<ModelQueryBuilder<RelatedInstance<T, K>, IS, IR>[RelationRetrieveMethod<T[K]>]>>;
6918
- }>;
6984
+ }, D>;
6919
6985
  load<RelationKey extends ModelRelation<T>>(relation: RelationKey, queryBuilder: (queryBuilder: RelationQueryBuilderType<RelatedInstance<T, RelationKey>, ModelWithoutRelations<RelatedInstance<T, RelationKey>>, {}>) => void): ModelQueryBuilder<T, S, R & {
6920
6986
  [K in RelationKey]: Awaited<ReturnType<ModelQueryBuilder<RelatedInstance<T, K>, ModelWithoutRelations<RelatedInstance<T, K>>, {}>[RelationRetrieveMethod<T[K]>]>>;
6921
- }>;
6987
+ }, D>;
6922
6988
  load<RelationKey extends ModelRelation<T>>(relation: RelationKey, options: LoadOptions): ModelQueryBuilder<T, S, R & {
6923
6989
  [K in RelationKey]: Awaited<ReturnType<ModelQueryBuilder<RelatedInstance<T, K>, ModelWithoutRelations<RelatedInstance<T, K>>, {}>[RelationRetrieveMethod<T[K]>]>>;
6924
- }>;
6990
+ }, D>;
6925
6991
  load<RelationKey extends ModelRelation<T>, IS extends Record<string, any> = ModelWithoutRelations<RelatedInstance<T, RelationKey>>, IR extends Record<string, any> = {}>(relation: RelationKey, queryBuilder: (queryBuilder: RelationQueryBuilderType<RelatedInstance<T, RelationKey>, ModelWithoutRelations<RelatedInstance<T, RelationKey>>, {}>) => RelationQueryBuilderType<RelatedInstance<T, RelationKey>, IS, IR>, options: LoadOptions): ModelQueryBuilder<T, S, R & {
6926
6992
  [K in RelationKey]: Awaited<ReturnType<ModelQueryBuilder<RelatedInstance<T, K>, IS, IR>[RelationRetrieveMethod<T[K]>]>>;
6927
- }>;
6993
+ }, D>;
6928
6994
  load<RelationKey extends ModelRelation<T>>(relation: RelationKey, queryBuilder: (queryBuilder: RelationQueryBuilderType<RelatedInstance<T, RelationKey>, ModelWithoutRelations<RelatedInstance<T, RelationKey>>, {}>) => void, options: LoadOptions): ModelQueryBuilder<T, S, R & {
6929
6995
  [K in RelationKey]: Awaited<ReturnType<ModelQueryBuilder<RelatedInstance<T, K>, ModelWithoutRelations<RelatedInstance<T, K>>, {}>[RelationRetrieveMethod<T[K]>]>>;
6930
- }>;
6996
+ }, D>;
6931
6997
  /**
6932
6998
  * @description Clears the relations from the query builder
6933
6999
  */
@@ -7017,7 +7083,7 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
7017
7083
  protected loadRelationViaBatch(relationQueryBuilder: ModelQueryBuilder<any>, models: T[]): Promise<void>;
7018
7084
  protected mapRelatedModelsToModels<R extends SelectedModel<T, ModelWithoutRelations<T>, Record<string, any>>>(relation: Relation, modelsToFillWithRelations: T[], relatedModels: R[]): void;
7019
7085
  protected getRelatedModelsForRelation(relationQueryBuilder: ModelQueryBuilder<any>, relation: Relation, models: T[]): Promise<SelectedModel<T, ModelWithoutRelations<T>, R>[]>;
7020
- protected getRelatedModelsQueryForRelation(relationQueryBuilder: ModelQueryBuilder<any>, relation: Relation, models: T[]): ModelQueryBuilder<any, any, any>;
7086
+ protected getRelatedModelsQueryForRelation(relationQueryBuilder: ModelQueryBuilder<any>, relation: Relation, models: T[]): ModelQueryBuilder<any, any, any, D>;
7021
7087
  protected getFilterValuesFromModelsForRelation(relation: Relation, models: T[]): any[];
7022
7088
  protected applyHavingRelatedFilter(relationQueryBuilder: ModelQueryBuilder<any>, relation: Relation, operator?: BinaryOperatorType$1, value?: BaseValues$1): void;
7023
7089
  }
@@ -8703,7 +8769,7 @@ declare abstract class BaseSeeder {
8703
8769
  abstract run(): Promise<void>;
8704
8770
  }
8705
8771
 
8706
- type HysteriaErrorCode = "VALIDATION_ERROR" | "CONNECTION_ALREADY_ESTABLISHED" | `UNSUPPORTED_ISOLATION_LEVEL_${string}` | "ROW_NOT_FOUND" | `UNSUPPORTED_DATABASE_TYPE_${string}` | `RELATION_TYPE_NOT_SUPPORTED_${string}` | `NOT_SUPPORTED_IN_${string}` | `RELATION_NOT_FOUND_IN_MODEL_${string}` | `UNKNOWN_RELATION_TYPE_${string}` | `DISTINCT_ON_NOT_SUPPORTED_IN_${string}` | `CONFLICT_COLUMNS_NOT_PRESENT_IN_DATA` | `CONFLICT_COLUMNS_NOT_PRESENT_IN_DATA_${string}` | `FOREIGN_KEY_VALUES_MISSING_FOR_HAS_ONE_RELATION_${string}` | `FOREIGN_KEY_VALUES_MISSING_FOR_BELONGS_TO_RELATION_${string}` | `PRIMARY_KEY_VALUES_MISSING_FOR_HAS_MANY_RELATION_${string}` | `MANY_TO_MANY_RELATION_NOT_FOUND_FOR_RELATED_MODEL_${string}` | `PRIMARY_KEY_VALUES_MISSING_FOR_MANY_TO_MANY_RELATION_${string}` | `RELATED_MODEL_DOES_NOT_HAVE_A_PRIMARY_KEY_${string}` | `FOR_SHARE_NOT_SUPPORTED_IN_${string}` | `SKIP_LOCKED_NOT_SUPPORTED_IN_${string}` | `LOCK_FOR_UPDATE_NOT_SUPPORTED_${string}` | `KEY_${string}_HAS_NO_HANDLER_IN_CACHE_KEYS_CONFIG` | `CACHE_ADAPTER_NOT_CONFIGURED` | `SQLITE_NOT_SUPPORTED` | `COCKROACHDB_NOT_SUPPORTED` | `RELATION_NOT_FOUND` | `POSTGRES_TABLE_REQUIRED` | `MODEL_HAS_NO_PRIMARY_KEY_VALUE` | `RELATION_NOT_MANY_TO_MANY` | "MATERIALIZED_CTE_NOT_SUPPORTED" | "DUPLICATE_MODEL_KEYS_WHILE_INSTANTIATING_MODELS" | "INVALID_ONE_PARAMETER_WHERE_CONDITION" | "INVALID_PAGINATION_PARAMETERS" | "MISSING_ALIAS_FOR_SUBQUERY" | "MODEL_HAS_NO_PRIMARY_KEY" | "PRIMARY_KEY_NOT_FOUND" | "ORDER_BY_REQUIRED" | "ORDER_BY_RAW_NOT_SUPPORTED" | "SQLITE_ONLY_SUPPORTS_SERIALIZABLE_ISOLATION_LEVEL" | "MUST_CALL_BUILD_CTE_AT_LEAST_ONCE" | "REGEXP_NOT_SUPPORTED_IN_SQLITE" | "MANY_TO_MANY_RELATION_MUST_HAVE_A_THROUGH_MODEL" | "INSERT_FAILED" | "MULTIPLE_PRIMARY_KEYS_NOT_ALLOWED" | "FILE_NOT_A_SQL_OR_TXT_FILE" | "CONNECTION_NOT_ESTABLISHED" | "TRANSACTION_NOT_ACTIVE" | "DEVELOPMENT_ERROR" | "MIGRATION_MODULE_NOT_FOUND" | "DRIVER_NOT_FOUND" | "FILE_NOT_FOUND_OR_NOT_ACCESSIBLE" | "ENV_NOT_SET" | "REQUIRED_VALUE_NOT_SET" | "SET_FAILED" | "GET_FAILED" | "REFERENCES_OPTION_REQUIRED" | "DELETE_FAILED" | "INVALID_DEFAULT_VALUE" | "DISCONNECT_FAILED" | "FLUSH_FAILED" | "LEFT_COLUMN_NOT_PROVIDED_FOR_JOIN" | "RIGHT_COLUMN_NOT_PROVIDED_FOR_JOIN" | "MODEL_HAS_NO_PRIMARY_KEY" | "GLOBAL_TRANSACTION_ALREADY_STARTED" | "GLOBAL_TRANSACTION_NOT_STARTED" | "MYSQL_REQUIRES_TABLE_NAME_FOR_INDEX_DROP" | "INVALID_DATE_OBJECT" | "INVALID_DATE_STRING" | "FAILED_TO_PARSE_DATE" | "MIGRATION_MODULE_REQUIRES_TS_NODE" | "FAILED_TO_ENCRYPT_SYMMETRICALLY" | "FAILED_TO_DECRYPT_SYMMETRICALLY" | "FAILED_TO_ENCRYPT_ASYMMETRICALLY" | "FAILED_TO_DECRYPT_ASYMMETRICALLY" | "UNSUPPORTED_RELATION_TYPE" | "LPUSH_FAILED" | "RPUSH_FAILED" | "LPOP_FAILED" | "RPOP_FAILED" | "LRANGE_FAILED" | "LLEN_FAILED" | "HSET_FAILED" | "HMSET_FAILED" | "HGET_FAILED" | "HGETALL_FAILED" | "HMGET_FAILED" | "HDEL_FAILED" | "HEXISTS_FAILED" | "HKEYS_FAILED" | "HLEN_FAILED" | "SADD_FAILED" | "SMEMBERS_FAILED" | "SREM_FAILED" | "SISMEMBER_FAILED" | "SCARD_FAILED" | "SINTER_FAILED" | "SUNION_FAILED" | "SDIFF_FAILED" | "ZADD_FAILED" | "ZRANGE_FAILED" | "ZREVRANGE_FAILED" | "ZREM_FAILED" | "ZSCORE_FAILED" | "ZCARD_FAILED" | "SUBSCRIBE_FAILED" | "UNSUBSCRIBE_FAILED" | "PUBLISH_FAILED" | "PSUBSCRIBE_FAILED" | "PUNSUBSCRIBE_FAILED" | "EXISTS_FAILED" | "EXPIRE_FAILED" | "EXPIREAT_FAILED" | "PEXPIRE_FAILED" | "TTL_FAILED" | "PTTL_FAILED" | "PERSIST_FAILED" | "KEYS_FAILED" | "RENAME_FAILED" | "TYPE_FAILED" | "SCAN_FAILED" | "ADMINJS_NOT_ENABLED" | "ADMINJS_INITIALIZATION_FAILED" | "ADMINJS_NO_MODELS_PROVIDED" | `BETTER_AUTH_MISSING_ID_${string}` | `BETTER_AUTH_INVALID_INCREMENT_${string}` | "ZOD_ENGINE_NOT_LOADED" | "ATOMIC_DATASOURCE_RESOLUTION_FAILED" | "ATOMIC_INVALID_METHOD" | "ATOMIC_CLS_DISABLED" | `SCOPE_NOT_FOUND_${string}`;
8772
+ type HysteriaErrorCode = "VALIDATION_ERROR" | "CONNECTION_ALREADY_ESTABLISHED" | `UNSUPPORTED_ISOLATION_LEVEL_${string}` | "ROW_NOT_FOUND" | `UNSUPPORTED_DATABASE_TYPE_${string}` | `RELATION_TYPE_NOT_SUPPORTED_${string}` | `NOT_SUPPORTED_IN_${string}` | `RELATION_NOT_FOUND_IN_MODEL_${string}` | `UNKNOWN_RELATION_TYPE_${string}` | `DISTINCT_ON_NOT_SUPPORTED_IN_${string}` | `CONFLICT_COLUMNS_NOT_PRESENT_IN_DATA` | `CONFLICT_COLUMNS_NOT_PRESENT_IN_DATA_${string}` | `FOREIGN_KEY_VALUES_MISSING_FOR_HAS_ONE_RELATION_${string}` | `FOREIGN_KEY_VALUES_MISSING_FOR_BELONGS_TO_RELATION_${string}` | `PRIMARY_KEY_VALUES_MISSING_FOR_HAS_MANY_RELATION_${string}` | `MANY_TO_MANY_RELATION_NOT_FOUND_FOR_RELATED_MODEL_${string}` | `PRIMARY_KEY_VALUES_MISSING_FOR_MANY_TO_MANY_RELATION_${string}` | `RELATED_MODEL_DOES_NOT_HAVE_A_PRIMARY_KEY_${string}` | `FOR_SHARE_NOT_SUPPORTED_IN_${string}` | `SKIP_LOCKED_NOT_SUPPORTED_IN_${string}` | `LOCK_FOR_UPDATE_NOT_SUPPORTED_${string}` | `KEY_${string}_HAS_NO_HANDLER_IN_CACHE_KEYS_CONFIG` | `CACHE_ADAPTER_NOT_CONFIGURED` | `SQLITE_NOT_SUPPORTED` | `COCKROACHDB_NOT_SUPPORTED` | `RELATION_NOT_FOUND` | `POSTGRES_TABLE_REQUIRED` | `MODEL_HAS_NO_PRIMARY_KEY_VALUE` | `RELATION_NOT_MANY_TO_MANY` | "MATERIALIZED_CTE_NOT_SUPPORTED" | "DUPLICATE_MODEL_KEYS_WHILE_INSTANTIATING_MODELS" | "INVALID_ONE_PARAMETER_WHERE_CONDITION" | "INVALID_PAGINATION_PARAMETERS" | "MISSING_ALIAS_FOR_SUBQUERY" | "MODEL_HAS_NO_PRIMARY_KEY" | "PRIMARY_KEY_NOT_FOUND" | "ORDER_BY_REQUIRED" | "ORDER_BY_RAW_NOT_SUPPORTED" | "INVALID_SQL_COMMENT" | "SQLITE_ONLY_SUPPORTS_SERIALIZABLE_ISOLATION_LEVEL" | "MUST_CALL_BUILD_CTE_AT_LEAST_ONCE" | "REGEXP_NOT_SUPPORTED_IN_SQLITE" | "MANY_TO_MANY_RELATION_MUST_HAVE_A_THROUGH_MODEL" | "INSERT_FAILED" | "MULTIPLE_PRIMARY_KEYS_NOT_ALLOWED" | "FILE_NOT_A_SQL_OR_TXT_FILE" | "CONNECTION_NOT_ESTABLISHED" | "TRANSACTION_NOT_ACTIVE" | "DEVELOPMENT_ERROR" | "MIGRATION_MODULE_NOT_FOUND" | "DRIVER_NOT_FOUND" | "FILE_NOT_FOUND_OR_NOT_ACCESSIBLE" | "ENV_NOT_SET" | "REQUIRED_VALUE_NOT_SET" | "SET_FAILED" | "GET_FAILED" | "REFERENCES_OPTION_REQUIRED" | "DELETE_FAILED" | "INVALID_DEFAULT_VALUE" | "DISCONNECT_FAILED" | "FLUSH_FAILED" | "LEFT_COLUMN_NOT_PROVIDED_FOR_JOIN" | "RIGHT_COLUMN_NOT_PROVIDED_FOR_JOIN" | "MODEL_HAS_NO_PRIMARY_KEY" | "GLOBAL_TRANSACTION_ALREADY_STARTED" | "GLOBAL_TRANSACTION_NOT_STARTED" | "MYSQL_REQUIRES_TABLE_NAME_FOR_INDEX_DROP" | "INVALID_DATE_OBJECT" | "INVALID_DATE_STRING" | "FAILED_TO_PARSE_DATE" | "MIGRATION_MODULE_REQUIRES_TS_NODE" | "FAILED_TO_ENCRYPT_SYMMETRICALLY" | "FAILED_TO_DECRYPT_SYMMETRICALLY" | "FAILED_TO_ENCRYPT_ASYMMETRICALLY" | "FAILED_TO_DECRYPT_ASYMMETRICALLY" | "UNSUPPORTED_RELATION_TYPE" | "LPUSH_FAILED" | "RPUSH_FAILED" | "LPOP_FAILED" | "RPOP_FAILED" | "LRANGE_FAILED" | "LLEN_FAILED" | "HSET_FAILED" | "HMSET_FAILED" | "HGET_FAILED" | "HGETALL_FAILED" | "HMGET_FAILED" | "HDEL_FAILED" | "HEXISTS_FAILED" | "HKEYS_FAILED" | "HLEN_FAILED" | "SADD_FAILED" | "SMEMBERS_FAILED" | "SREM_FAILED" | "SISMEMBER_FAILED" | "SCARD_FAILED" | "SINTER_FAILED" | "SUNION_FAILED" | "SDIFF_FAILED" | "ZADD_FAILED" | "ZRANGE_FAILED" | "ZREVRANGE_FAILED" | "ZREM_FAILED" | "ZSCORE_FAILED" | "ZCARD_FAILED" | "SUBSCRIBE_FAILED" | "UNSUBSCRIBE_FAILED" | "PUBLISH_FAILED" | "PSUBSCRIBE_FAILED" | "PUNSUBSCRIBE_FAILED" | "EXISTS_FAILED" | "EXPIRE_FAILED" | "EXPIREAT_FAILED" | "PEXPIRE_FAILED" | "TTL_FAILED" | "PTTL_FAILED" | "PERSIST_FAILED" | "KEYS_FAILED" | "RENAME_FAILED" | "TYPE_FAILED" | "SCAN_FAILED" | "ADMINJS_NOT_ENABLED" | "ADMINJS_INITIALIZATION_FAILED" | "ADMINJS_NO_MODELS_PROVIDED" | `BETTER_AUTH_MISSING_ID_${string}` | `BETTER_AUTH_INVALID_INCREMENT_${string}` | "ZOD_ENGINE_NOT_LOADED" | "ATOMIC_DATASOURCE_RESOLUTION_FAILED" | "ATOMIC_INVALID_METHOD" | "ATOMIC_CLS_DISABLED" | `SCOPE_NOT_FOUND_${string}`;
8707
8773
 
8708
8774
  declare class HysteriaError extends Error {
8709
8775
  code: HysteriaErrorCode;
@@ -8866,4 +8932,4 @@ type BetterAuthAdapterConfig = Partial<Pick<AdapterFactoryConfig, "usePlural" |
8866
8932
  */
8867
8933
  declare function betterAuthAdapter(sql: SqlDataSource, config?: BetterAuthAdapterConfig): (options: BetterAuthOptions) => DBAdapter;
8868
8934
 
8869
- export { type AdminJsActionOptions, type AdminJsAssets, type AdminJsBranding, type AdminJsInstance, type AdminJsLocale, type AdminJsOptions, type AdminJsPage, type AdminJsPropertyOptions, type AdminJsResourceOptions, type AdminJsSettings, type AllowedDrivers, type AnyModelConstructor, type AnySqlDataSourceInput, type AtomicOptions, type BaseModelMethodOptions, BaseSeeder, type BeginTransactionOptions, type BetterAuthAdapterConfig, type BuildSelectType, type BuildSingleSelectType, type BuiltinDriverName, type CacheAdapter, type CacheKeys, ClientMigrator, type ColCharOptions, type ColComputedOptions, type ColJsonbOptions, type ColMediumIntOptions, type ColSmallIntOptions, type ColTinyIntOptions, type ColVarbinaryOptions, Collection, type CollectionDefinition, type ColumnDef, type CommonDataSourceInput, type ComposeBuildSelect, type ComposeSelect, type ComputedColumnDef, type ConnectionPolicies, type CreateSchemaResult, type CustomLogger, type DataSourceInput, type DataSourceType, type DateAutoHook, type DefinedCollection, type DefinedModel, type DefinedView, type DriverAdapter, type DriverAdapterFactory, type DriverAdapterFactoryContext, type EndTransactionOptions, type ExcludeMethods, type ExecuteOptions, type ExtractColumnName, type ExtractSourceColumn, type FindReturnType, type GetColumnType, type GetConnectionReturnType, HysteriaError, type HysteriaErrorCode, InMemoryAdapter, type InferPK, type IntrospectedColumn, type IntrospectedForeignKey, type IntrospectedSchema, type IntrospectedTable, type JsEnvironmentValue, type JsonPathInput, type JsonPaths, type LoadOptions, type LoggerConfig, Migration, type MigrationConfig, type MigrationConfigBase, type MigrationLockConfig, type ModelColumns, type ModelDataProperties, type ModelInstanceType, type ModelKey, ModelQueryBuilder, type ModelQueryResult, type ModelRelation, type ModelSelectTuple, type ModelSelectableInput, type ModelStream, type ModelWithoutRelations, type ModelsProxy, MongoDataSource, type MongoDataSourceInput$1 as MongoDataSourceInput, type MssqlConnectionInstance, type MssqlDataSourceInput, type MssqlPoolInstance, type MutationReturningResult, type MysqlConnectionInstance, type MysqlSqlDataSourceInput, type NotNullableMysqlSqlDataSourceInput, type NotNullableOracleMssqlDataSourceInput, type NotNullablePostgresSqlDataSourceInput, type NotNullableSqliteDataSourceInput, type NullableColumn, type NumberModelKey, ObserverChain, ObserverChainWrapper, type Operation, type PgPoolClientInstance, type PingResult, type PlatformAdapter, type PlatformFs, type PlatformPath, PlatformUnsupportedError, type PostgresSqlDataSourceInput, type PrimaryColumnDef, type PropNamespace, type PropertyDef, QueryBuilder, type QueryContext, type QueryContextWithDuration, type QueryObserver, type RawModelKey, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelatedInstance, type RelationDef, type RelationDefinitions, type RelationHelpers, type RelationLoadStrategy, type RelationQueryBuilderType, type ReplicationType, type ResolveColumnType, type ResolveJsonPathType, type ResolvedJsEnvironment, type ReturningColumns, type ReturningKey, type ReturningParam, type ReturningResult, type ReturningResultMany, type ReturningSupported, Schema, SchemaBuilder, type SchemaLookup, type SchemaRelDef, type SeederConfig, type SelectBrand, type SelectableColumn, type SelectedModel, type SlaveAlgorithm, type SlaveContext, type SqlCloneOptions, SqlDataSource, type SqlDataSourceInput, type SqlDataSourceModel, type SqlDataSourceType, type SqlDriverSpecificOptions, SqlFuncNode, type SqlFuncRenderer, type SqlPoolType, type Sqlite3ConnectionOptions, type SqliteConnectionInstance, type SqliteDataSourceInput, type StartTransactionOptions, type StripTablePrefix, type SubQueryable, type TableFormat, Transaction, type TransactionExecutionOptions, type TypedDefault, type TypedJsonPathInput, type TypedPrepare, type TypedSerialize, type UseCacheReturnType, type UseConnectionInput, type ValidationContext, ValidationError, type ValidationResult, type Validator, type ViewDefinition, WriteOperation, type WriteReturnType, atomic, betterAuthAdapter, col, createSchema, defineCollection, defineMigrator, defineModel, defineModelFactory, defineRelations, defineView, deriveOperationFromQuery, email, enumValidator, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, type getPoolReturnType, loadPlatform, HysteriaLogger as logger, max, maxLength, min, minLength, pattern, prop, RedisDataSource as redis, registerDriverAdapter, registerSqlFuncRenderer, required, sqlFunc, url };
8935
+ export { type AdminJsActionOptions, type AdminJsAssets, type AdminJsBranding, type AdminJsInstance, type AdminJsLocale, type AdminJsOptions, type AdminJsPage, type AdminJsPropertyOptions, type AdminJsResourceOptions, type AdminJsSettings, type AllowedDrivers, type AnyModelConstructor, type AnySqlDataSourceInput, type AtomicOptions, type BaseModelMethodOptions, BaseSeeder, type BeginTransactionOptions, type BetterAuthAdapterConfig, type BuildSelectType, type BuildSingleSelectType, type BuiltinDriverName, type CacheAdapter, type CacheKeys, ClientMigrator, type ColCharOptions, type ColComputedOptions, type ColJsonbOptions, type ColMediumIntOptions, type ColSmallIntOptions, type ColTinyIntOptions, type ColVarbinaryOptions, Collection, type CollectionDefinition, type ColumnDef, type CommonDataSourceInput, type ComposeBuildSelect, type ComposeSelect, type ComputedColumnDef, type ConnectionPolicies, type CreateSchemaResult, type CustomLogger, type DataSourceInput, type DataSourceType, type DateAutoHook, type DefinedCollection, type DefinedModel, type DefinedView, type DriverAdapter, type DriverAdapterFactory, type DriverAdapterFactoryContext, type EndTransactionOptions, type ExcludeMethods, type ExecuteOptions, type ExtractColumnName, type ExtractSourceColumn, type FindReturnType, type GetColumnType, type GetConnectionReturnType, HysteriaError, type HysteriaErrorCode, InMemoryAdapter, type InferPK, type IntrospectedColumn, type IntrospectedForeignKey, type IntrospectedSchema, type IntrospectedTable, type JsEnvironmentValue, type JsonPathInput, type JsonPaths, type LoadOptions, type LoggerConfig, Migration, type MigrationConfig, type MigrationConfigBase, type MigrationLockConfig, type ModelColumns, type ModelDataProperties, type ModelInstanceType, type ModelKey, ModelQueryBuilder, type ModelQueryResult, type ModelRelation, type ModelSelectTuple, type ModelSelectableInput, type ModelStream, type ModelWithoutRelations, type ModelsProxy, MongoDataSource, type MongoDataSourceInput$1 as MongoDataSourceInput, type MssqlComment, type MssqlConnectionInstance, type MssqlDataSourceInput, type MssqlPoolInstance, type MutationReturningResult, type MySqlComment, type MysqlConnectionInstance, type MysqlSqlDataSourceInput, type NotNullableMysqlSqlDataSourceInput, type NotNullableOracleMssqlDataSourceInput, type NotNullablePostgresSqlDataSourceInput, type NotNullableSqliteDataSourceInput, type NullableColumn, type NumberModelKey, ObserverChain, ObserverChainWrapper, type Operation, type PgComment, type PgPoolClientInstance, type PingResult, type PlatformAdapter, type PlatformFs, type PlatformPath, PlatformUnsupportedError, type PostgresSqlDataSourceInput, type PrimaryColumnDef, type PropNamespace, type PropertyDef, QueryBuilder, type QueryContext, type QueryContextWithDuration, type QueryObserver, type RawModelKey, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelatedInstance, type RelationDef, type RelationDefinitions, type RelationHelpers, type RelationLoadStrategy, type RelationQueryBuilderType, type ReplicationType, type ResolveColumnType, type ResolveJsonPathType, type ResolvedJsEnvironment, type ReturningColumns, type ReturningKey, type ReturningParam, type ReturningResult, type ReturningResultMany, type ReturningSupported, Schema, SchemaBuilder, type SchemaLookup, type SchemaRelDef, type SeederConfig, type SelectBrand, type SelectableColumn, type SelectedModel, type SlaveAlgorithm, type SlaveContext, type SqlCloneOptions, type SqlComment, SqlDataSource, type SqlDataSourceInput, type SqlDataSourceModel, type SqlDataSourceType, type SqlDriverSpecificOptions, SqlFuncNode, type SqlFuncRenderer, type SqlHint, type SqlPoolType, type Sqlite3ConnectionOptions, type SqliteComment, type SqliteConnectionInstance, type SqliteDataSourceInput, type StartTransactionOptions, type StripTablePrefix, type SubQueryable, type TableFormat, Transaction, type TransactionExecutionOptions, type TypedDefault, type TypedJsonPathInput, type TypedPrepare, type TypedSerialize, type UseCacheReturnType, type UseConnectionInput, type ValidationContext, ValidationError, type ValidationResult, type Validator, type ViewDefinition, WriteOperation, type WriteReturnType, atomic, betterAuthAdapter, col, createSchema, defineCollection, defineMigrator, defineModel, defineModelFactory, defineRelations, defineView, deriveOperationFromQuery, email, enumValidator, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, type getPoolReturnType, loadPlatform, HysteriaLogger as logger, max, maxLength, min, minLength, pattern, prop, RedisDataSource as redis, registerDriverAdapter, registerSqlFuncRenderer, required, sqlFunc, url };