hysteria-orm 10.7.1 → 10.7.3

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.cts CHANGED
@@ -34,6 +34,39 @@ declare abstract class Entity {
34
34
  static databaseCaseConvention: CaseConvention;
35
35
  }
36
36
 
37
+ type CustomLogger = {
38
+ info(message: string): void;
39
+ error(message: string): void;
40
+ warn(message: string): void;
41
+ };
42
+ /**
43
+ * @description Configuration for logging behavior
44
+ * @warning Logs are synchronous by default and add overhead — do not use in production unless you override with an async custom logger. Logs are mainly for debugging.
45
+ */
46
+ type LoggerConfig = {
47
+ /**
48
+ * @description Minimum log level. Messages below this level are suppressed.
49
+ * @default "info"
50
+ */
51
+ level?: "info" | "warn" | "error";
52
+ /**
53
+ * @description Whether to log SQL/Mongo queries.
54
+ * @default true
55
+ */
56
+ logQueries?: boolean;
57
+ /**
58
+ * @description Custom logger instance. When provided, replaces the default console logger.
59
+ */
60
+ customLogger?: CustomLogger;
61
+ };
62
+ declare class HysteriaLogger {
63
+ static loggerInstance: CustomLogger;
64
+ static setCustomLogger(customLogger: CustomLogger): void;
65
+ static info(message: string): void;
66
+ static error(message: string | Error): void;
67
+ static warn(message: string): void;
68
+ }
69
+
37
70
  /**
38
71
  * @description Creates a datasource for the selected database type with the provided credentials
39
72
  */
@@ -56,7 +89,7 @@ interface OracleDBDataSourceInput extends CommonDataSourceInput {
56
89
  }
57
90
  interface CommonDataSourceInput {
58
91
  readonly type?: DataSourceType;
59
- readonly logs?: boolean;
92
+ readonly logs?: boolean | LoggerConfig;
60
93
  }
61
94
  interface MongoDataSourceInput$1 extends CommonDataSourceInput {
62
95
  readonly type: "mongo";
@@ -185,9 +218,9 @@ declare class MongoQueryBuilder<T extends Collection> {
185
218
  protected mongoDataSource: MongoDataSource;
186
219
  protected collection: Collection$1<T>;
187
220
  protected model: typeof Collection;
188
- protected logs: boolean;
221
+ protected logs: boolean | LoggerConfig;
189
222
  protected session?: ReturnType<MongoDataSource["startSession"]>;
190
- constructor(model: typeof Collection, mongoDataSource: MongoDataSource, _session?: ReturnType<MongoDataSource["startSession"]>, logs?: boolean);
223
+ constructor(model: typeof Collection, mongoDataSource: MongoDataSource, _session?: ReturnType<MongoDataSource["startSession"]>, logs?: boolean | LoggerConfig);
191
224
  one(options?: OneOptions$1): Promise<T | null>;
192
225
  oneOrFail(options?: OneOptions$1): Promise<T>;
193
226
  many(options?: ManyOptions$1): Promise<T[]>;
@@ -475,7 +508,7 @@ declare abstract class DataSource {
475
508
  password: string;
476
509
  database: string;
477
510
  url: string;
478
- logs: boolean;
511
+ logs: boolean | LoggerConfig;
479
512
  protected constructor(input?: DataSourceInput);
480
513
  protected handleCockroachdbSource(input?: PostgresSqlDataSourceInput): void;
481
514
  protected handlePostgresSource(input?: PostgresSqlDataSourceInput): void;
@@ -507,13 +540,13 @@ type MongoUnrestrictedFindManyOptions<T extends Collection> = UnrestrictedMongoF
507
540
  offset?: number;
508
541
  };
509
542
  declare class CollectionManager<T extends Collection> {
510
- protected logs: boolean;
543
+ protected logs: boolean | LoggerConfig;
511
544
  protected collection: typeof Collection;
512
545
  protected mongoClient: ReturnType<MongoDataSource["getCurrentConnection"]>;
513
546
  protected mongoDataSource: MongoDataSource;
514
547
  protected collectionInstance: MongoClientImport["Collection"]["prototype"];
515
548
  protected session?: ReturnType<MongoDataSource["startSession"]>;
516
- constructor(_collection: typeof Collection, mongoDataSource: MongoDataSource, session?: ReturnType<MongoDataSource["startSession"]>, logs?: boolean);
549
+ constructor(_collection: typeof Collection, mongoDataSource: MongoDataSource, session?: ReturnType<MongoDataSource["startSession"]>, logs?: boolean | LoggerConfig);
517
550
  /**
518
551
  * @description Finds all records that match the input
519
552
  */
@@ -555,10 +588,11 @@ declare class CollectionManager<T extends Collection> {
555
588
  }
556
589
 
557
590
  type MongoClientInstance = InstanceType<MongoClientImport["MongoClient"]>;
591
+
558
592
  interface MongoDataSourceInput {
559
593
  url?: string;
560
594
  options?: MongoConnectionOptions;
561
- logs?: boolean;
595
+ logs?: boolean | LoggerConfig;
562
596
  }
563
597
  declare class MongoDataSource extends DataSource {
564
598
  url: string;
@@ -1389,9 +1423,11 @@ type SeederConfig = {
1389
1423
  */
1390
1424
  type SqlDataSourceInputBase<T extends Record<string, SqlDataSourceModel> = {}, C extends CacheKeys = {}, D extends SqlDataSourceType = SqlDataSourceType> = {
1391
1425
  /**
1392
- * @description Whether to log the sql queries and other debug information
1426
+ * @description Whether to log the sql queries and other debug information. Can be a boolean or a LoggerConfig object for granular control.
1427
+ * @warning Logs are synchronous by default and add overhead — do not use in production unless you override with an async custom logger.
1428
+ * @default false
1393
1429
  */
1394
- readonly logs?: boolean;
1430
+ readonly logs?: boolean | LoggerConfig;
1395
1431
  /**
1396
1432
  * @description The connection policies to use for the sql data source that are not configured in the driverOptions
1397
1433
  */
@@ -1481,7 +1517,7 @@ type UseConnectionInput<D extends SqlDataSourceType = SqlDataSourceType, T exten
1481
1517
  * @description The type of the database to connect to
1482
1518
  */
1483
1519
  readonly type: D;
1484
- readonly logs?: boolean;
1520
+ readonly logs?: boolean | LoggerConfig;
1485
1521
  readonly models?: T;
1486
1522
  readonly driverOptions?: SqlDriverSpecificOptions<D>;
1487
1523
  connectionPolicies?: ConnectionPolicies;
@@ -3317,7 +3353,7 @@ declare abstract class FooterQueryBuilder<T extends Model, S extends Record<stri
3317
3353
  protected offsetNode: OffsetNode | null;
3318
3354
  protected modelColumns: ColumnType[];
3319
3355
  protected modelColumnsMap: Map<string, ColumnType>;
3320
- protected logs: boolean;
3356
+ protected logs: boolean | LoggerConfig;
3321
3357
  protected constructor(model: typeof Model, sqlDataSource: SqlDataSource);
3322
3358
  /**
3323
3359
  * @description Clears the group by query
@@ -3825,6 +3861,27 @@ declare abstract class WhereQueryBuilder<T extends Model, S extends Record<strin
3825
3861
  orWhere<K extends ModelKey<T>>(column: K, value: WhereColumnValue<T, K>): this;
3826
3862
  orWhere(column: `${string}.${string}`, operator: BinaryOperatorType, value: BaseValues): this;
3827
3863
  orWhere(column: `${string}.${string}`, value: BaseValues): this;
3864
+ /**
3865
+ * @description Adds a WHERE condition comparing two columns.
3866
+ */
3867
+ whereColumn<K extends ModelKey<T>>(column: K, referenceColumn: ModelKey<T>): this;
3868
+ whereColumn<K extends ModelKey<T>>(column: K, operator: BinaryOperatorType, referenceColumn: ModelKey<T>): this;
3869
+ whereColumn(column: `${string}.${string}`, referenceColumn: `${string}.${string}`): this;
3870
+ whereColumn(column: `${string}.${string}`, operator: BinaryOperatorType, referenceColumn: `${string}.${string}`): this;
3871
+ /**
3872
+ * @description Adds an AND WHERE condition comparing two columns.
3873
+ */
3874
+ andWhereColumn<K extends ModelKey<T>>(column: K, referenceColumn: ModelKey<T>): this;
3875
+ andWhereColumn<K extends ModelKey<T>>(column: K, operator: BinaryOperatorType, referenceColumn: ModelKey<T>): this;
3876
+ andWhereColumn(column: `${string}.${string}`, referenceColumn: `${string}.${string}`): this;
3877
+ andWhereColumn(column: `${string}.${string}`, operator: BinaryOperatorType, referenceColumn: `${string}.${string}`): this;
3878
+ /**
3879
+ * @description Adds an OR WHERE condition comparing two columns.
3880
+ */
3881
+ orWhereColumn<K extends ModelKey<T>>(column: K, referenceColumn: ModelKey<T>): this;
3882
+ orWhereColumn<K extends ModelKey<T>>(column: K, operator: BinaryOperatorType, referenceColumn: ModelKey<T>): this;
3883
+ orWhereColumn(column: `${string}.${string}`, referenceColumn: `${string}.${string}`): this;
3884
+ orWhereColumn(column: `${string}.${string}`, operator: BinaryOperatorType, referenceColumn: `${string}.${string}`): this;
3828
3885
  /**
3829
3886
  * @description Adds a negated WHERE condition to the query.
3830
3887
  */
@@ -4370,7 +4427,7 @@ type ComposeRawSelect<S extends Record<string, any>, Added extends Record<string
4370
4427
  * @typeParam Columns - The columns being selected
4371
4428
  */
4372
4429
  type ComposeBuildRawSelect<S extends Record<string, any>, Columns extends readonly Selectable[]> = (typeof RAW_SELECT_BRAND extends keyof S ? S : {}) & BuildRawSelectType<Columns>;
4373
- type WhereOnlyQueryBuilder<T extends Model> = Pick<WhereQueryBuilder<T>, "where" | "andWhere" | "orWhere" | "whereNot" | "andWhereNot" | "orWhereNot" | "whereIn" | "andWhereIn" | "orWhereIn" | "whereNotIn" | "andWhereNotIn" | "orWhereNotIn" | "whereBetween" | "andWhereBetween" | "orWhereBetween" | "whereNotBetween" | "andWhereNotBetween" | "orWhereNotBetween" | "whereNull" | "andWhereNull" | "orWhereNull" | "whereNotNull" | "andWhereNotNull" | "orWhereNotNull" | "whereLike" | "andWhereLike" | "orWhereLike" | "whereILike" | "andWhereILike" | "orWhereILike" | "whereNotLike" | "andWhereNotLike" | "orWhereNotLike" | "whereNotILike" | "andWhereNotILike" | "orWhereNotILike" | "whereRegexp" | "andWhereRegexp" | "orWhereRegexp" | "whereNotRegexp" | "andWhereNotRegexp" | "orWhereNotRegexp" | "whereRaw" | "andWhereRaw" | "orWhereRaw" | "whereExists" | "orWhereExists" | "andWhereExists"> & Pick<JsonQueryBuilder<T>, "whereJson" | "andWhereJson" | "orWhereJson" | "whereJsonContains" | "andWhereJsonContains" | "orWhereJsonContains" | "whereJsonNotContains" | "andWhereJsonNotContains" | "orWhereJsonNotContains" | "whereJsonNotContains" | "andWhereJsonNotContains" | "orWhereJsonNotContains" | "whereJsonRaw" | "andWhereJsonRaw" | "orWhereJsonRaw" | "whereJsonNotContains" | "andWhereJsonNotContains" | "orWhereJsonNotContains">;
4430
+ type WhereOnlyQueryBuilder<T extends Model> = Pick<WhereQueryBuilder<T>, "where" | "andWhere" | "orWhere" | "whereNot" | "andWhereNot" | "orWhereNot" | "whereIn" | "andWhereIn" | "orWhereIn" | "whereNotIn" | "andWhereNotIn" | "orWhereNotIn" | "whereBetween" | "andWhereBetween" | "orWhereBetween" | "whereNotBetween" | "andWhereNotBetween" | "orWhereNotBetween" | "whereNull" | "andWhereNull" | "orWhereNull" | "whereNotNull" | "andWhereNotNull" | "orWhereNotNull" | "whereLike" | "andWhereLike" | "orWhereLike" | "whereILike" | "andWhereILike" | "orWhereILike" | "whereNotLike" | "andWhereNotLike" | "orWhereNotLike" | "whereNotILike" | "andWhereNotILike" | "orWhereNotILike" | "whereRegexp" | "andWhereRegexp" | "orWhereRegexp" | "whereNotRegexp" | "andWhereNotRegexp" | "orWhereNotRegexp" | "whereRaw" | "andWhereRaw" | "orWhereRaw" | "whereExists" | "orWhereExists" | "andWhereExists" | "whereNotExists" | "orWhereNotExists" | "andWhereNotExists" | "whereColumn" | "andWhereColumn" | "orWhereColumn"> & Pick<JsonQueryBuilder<T>, "whereJson" | "andWhereJson" | "orWhereJson" | "whereJsonContains" | "andWhereJsonContains" | "orWhereJsonContains" | "whereJsonNotContains" | "andWhereJsonNotContains" | "orWhereJsonNotContains" | "whereJsonNotContains" | "andWhereJsonNotContains" | "orWhereJsonNotContains" | "whereJsonRaw" | "andWhereJsonRaw" | "orWhereJsonRaw" | "whereJsonNotContains" | "andWhereJsonNotContains" | "orWhereJsonNotContains">;
4374
4431
  type RelationRetrieveMethod<P extends any> = P extends any[] ? "many" : "one";
4375
4432
  /**
4376
4433
  * Validates a column string for raw query builder select().
@@ -4953,7 +5010,7 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
4953
5010
  declare class ModelManager<T extends Model> {
4954
5011
  protected sqlDataSource: SqlDataSource;
4955
5012
  protected sqlType: SqlDataSourceType;
4956
- protected logs: boolean;
5013
+ protected logs: boolean | LoggerConfig;
4957
5014
  protected model: typeof Model;
4958
5015
  protected modelInstance: T;
4959
5016
  protected astParser: AstParser;
@@ -5128,7 +5185,7 @@ declare class Transaction {
5128
5185
  * @description If a callback is provided, it will execute the callback and commit or rollback the nested transaction save points based on the callback's success or failure
5129
5186
  */
5130
5187
  nestedTransaction(): Promise<Transaction>;
5131
- nestedTransaction(cb: (trx: Transaction) => Promise<void>): Promise<void>;
5188
+ nestedTransaction<T>(cb: (trx: Transaction) => Promise<T>): Promise<T>;
5132
5189
  /**
5133
5190
  * @description Starts a transaction, automatically handled from the sql data source instance in the `transaction` method
5134
5191
  */
@@ -5446,7 +5503,7 @@ declare class SqlDataSource<D extends SqlDataSourceType = SqlDataSourceType, T e
5446
5503
  * @sqlite ignores the isolation level
5447
5504
  */
5448
5505
  transaction(options?: StartTransactionOptions): Promise<Transaction>;
5449
- transaction(cb: (trx: Transaction) => Promise<void>, options?: StartTransactionOptions): Promise<void>;
5506
+ transaction<T>(cb: (trx: Transaction) => Promise<T>, options?: StartTransactionOptions): Promise<T>;
5450
5507
  /**
5451
5508
  * @description Returns a ModelManager instance for the given model
5452
5509
  */
@@ -7795,9 +7852,9 @@ declare class Schema {
7795
7852
  }
7796
7853
 
7797
7854
  declare abstract class Migration {
7798
- dbType: SqlDataSourceType;
7799
- migrationName: string;
7800
- schema: Schema;
7855
+ readonly dbType: SqlDataSourceType;
7856
+ readonly migrationName: string;
7857
+ readonly schema: Schema;
7801
7858
  constructor(dbType: SqlDataSourceType);
7802
7859
  /**
7803
7860
  * @description This method is called when the migration is to be run
@@ -7841,19 +7898,6 @@ declare class ClientMigrator {
7841
7898
  */
7842
7899
  declare const defineMigrator: (migrationPath: string, sqlDataSourceInput?: SqlDataSource["inputDetails"] | SqlDataSource) => ClientMigrator;
7843
7900
 
7844
- type CustomLogger = {
7845
- info(message: string): void;
7846
- error(message: string): void;
7847
- warn(message: string): void;
7848
- };
7849
- declare class HysteriaLogger {
7850
- static loggerInstance: CustomLogger;
7851
- static setCustomLogger(customLogger: CustomLogger): void;
7852
- static info(message: string): void;
7853
- static error(message: string | Error): void;
7854
- static warn(message: string): void;
7855
- }
7856
-
7857
7901
  /**
7858
7902
  * @description Base class for all seeders
7859
7903
  * @description Provides access to the SqlDataSource instance
@@ -7903,4 +7947,4 @@ declare const generateOpenApiModelWithMetadata: <T extends new () => Model>(mode
7903
7947
  $id?: string;
7904
7948
  }>;
7905
7949
 
7906
- export { type AbstractConstructor, type AdminJsActionOptions, type AdminJsAssets, type AdminJsBranding, type AdminJsInstance, type AdminJsLocale, type AdminJsOptions, type AdminJsPage, type AdminJsPropertyOptions, type AdminJsResourceOptions, type AdminJsSettings, type AnyConstructor, type AsymmetricEncryptionOptions, type BaseModelMethodOptions, type BaseModelRelationType, BaseSeeder, type BigIntFields, type BuildSelectType, type BuildSingleSelectType, type CacheAdapter, type CacheKeys, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnOptions, type ColumnType, type CommonDataSourceInput, type ComposeBuildSelect, type ComposeSelect, type ConnectionPolicies, type Constructor, type DataSourceInput, type DataSourceType, type DateColumnOptions, type DatetimeColumnOptions, type ExcludeMethods, type ExtractColumnName, type ExtractSourceColumn, type FetchHooks, type FindReturnType, type GetColumnType, type GetConnectionReturnType, HysteriaError, InMemoryAdapter, type IncrementFields, type IndexType, type LazyRelationType, type ManyOptions, type ManyToManyOptions, type ManyToManyStringOptions, Migration, type MigrationConfig, type MigrationConfigBase, type MixinColumns, MixinFactory, Model, type ModelDataProperties, type ModelInstanceType, type ModelKey, ModelQueryBuilder, type ModelQueryResult, type ModelRelation, type ModelSelectTuple, type ModelSelectableInput, type ModelWithoutRelations, MongoDataSource, type MongoDataSourceInput$1 as MongoDataSourceInput, type MssqlConnectionInstance, type MssqlDataSourceInput, type MssqlPoolInstance, type MysqlConnectionInstance, type MysqlSqlDataSourceInput, type NotNullableMysqlSqlDataSourceInput, type NotNullableOracleDBDataSourceInput, type NotNullableOracleMssqlDataSourceInput, type NotNullablePostgresSqlDataSourceInput, type NotNullableSqliteDataSourceInput, type NumberModelKey, type OneOptions, type OracleDBDataSourceInput, type OracleDBPoolInstance, type PgPoolClientInstance, type PostgresSqlDataSourceInput, QueryBuilder, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelatedInstance, type RelationQueryBuilderType, type ReplicationType, type ReturningColumns, type ReturningKey, Schema, SchemaBuilder, type SeederConfig, type SelectBrand, type SelectableColumn, type SelectedModel, type SlaveAlgorithm, type SlaveContext, type SqlCloneOptions, SqlDataSource, type SqlDataSourceInput, type SqlDataSourceModel, type SqlDataSourceType, type SqlDriverSpecificOptions, type SqlPoolType, type Sqlite3ConnectionOptions, type SqliteConnectionInstance, type SqliteDataSourceInput, type StartTransactionOptions, type SymmetricEncryptionOptions, type TableFormat, type ThroughModel, type TimestampFields, Transaction, type TransactionExecutionOptions, type TypedPropertyDecorator, type UlidFields, UlidMixin, type UniqueType, type UseCacheReturnType, type UseConnectionInput, type UuidFields, UuidMixin, WriteOperation, type WriteReturnType, belongsTo, bigIntMixin, column, createMixin, createModelFactory, defineMigrator, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, incrementMixin, index, HysteriaLogger as logger, manyToMany, property, RedisDataSource as redis, timestampMixin, ulidMixin, unique, uuidMixin, view, withPerformance };
7950
+ export { type AbstractConstructor, type AdminJsActionOptions, type AdminJsAssets, type AdminJsBranding, type AdminJsInstance, type AdminJsLocale, type AdminJsOptions, type AdminJsPage, type AdminJsPropertyOptions, type AdminJsResourceOptions, type AdminJsSettings, type AnyConstructor, type AsymmetricEncryptionOptions, type BaseModelMethodOptions, type BaseModelRelationType, BaseSeeder, type BigIntFields, type BuildSelectType, type BuildSingleSelectType, type CacheAdapter, type CacheKeys, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnOptions, type ColumnType, type CommonDataSourceInput, type ComposeBuildSelect, type ComposeSelect, type ConnectionPolicies, type Constructor, type CustomLogger, type DataSourceInput, type DataSourceType, type DateColumnOptions, type DatetimeColumnOptions, type ExcludeMethods, type ExtractColumnName, type ExtractSourceColumn, type FetchHooks, type FindReturnType, type GetColumnType, type GetConnectionReturnType, HysteriaError, InMemoryAdapter, type IncrementFields, type IndexType, type LazyRelationType, type LoggerConfig, type ManyOptions, type ManyToManyOptions, type ManyToManyStringOptions, Migration, type MigrationConfig, type MigrationConfigBase, type MixinColumns, MixinFactory, Model, type ModelDataProperties, type ModelInstanceType, type ModelKey, ModelQueryBuilder, type ModelQueryResult, type ModelRelation, type ModelSelectTuple, type ModelSelectableInput, type ModelWithoutRelations, MongoDataSource, type MongoDataSourceInput$1 as MongoDataSourceInput, type MssqlConnectionInstance, type MssqlDataSourceInput, type MssqlPoolInstance, type MysqlConnectionInstance, type MysqlSqlDataSourceInput, type NotNullableMysqlSqlDataSourceInput, type NotNullableOracleDBDataSourceInput, type NotNullableOracleMssqlDataSourceInput, type NotNullablePostgresSqlDataSourceInput, type NotNullableSqliteDataSourceInput, type NumberModelKey, type OneOptions, type OracleDBDataSourceInput, type OracleDBPoolInstance, type PgPoolClientInstance, type PostgresSqlDataSourceInput, QueryBuilder, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelatedInstance, type RelationQueryBuilderType, type ReplicationType, type ReturningColumns, type ReturningKey, Schema, SchemaBuilder, type SeederConfig, type SelectBrand, type SelectableColumn, type SelectedModel, type SlaveAlgorithm, type SlaveContext, type SqlCloneOptions, SqlDataSource, type SqlDataSourceInput, type SqlDataSourceModel, type SqlDataSourceType, type SqlDriverSpecificOptions, type SqlPoolType, type Sqlite3ConnectionOptions, type SqliteConnectionInstance, type SqliteDataSourceInput, type StartTransactionOptions, type SymmetricEncryptionOptions, type TableFormat, type ThroughModel, type TimestampFields, Transaction, type TransactionExecutionOptions, type TypedPropertyDecorator, type UlidFields, UlidMixin, type UniqueType, type UseCacheReturnType, type UseConnectionInput, type UuidFields, UuidMixin, WriteOperation, type WriteReturnType, belongsTo, bigIntMixin, column, createMixin, createModelFactory, defineMigrator, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, incrementMixin, index, HysteriaLogger as logger, manyToMany, property, RedisDataSource as redis, timestampMixin, ulidMixin, unique, uuidMixin, view, withPerformance };
package/lib/index.d.ts CHANGED
@@ -34,6 +34,39 @@ declare abstract class Entity {
34
34
  static databaseCaseConvention: CaseConvention;
35
35
  }
36
36
 
37
+ type CustomLogger = {
38
+ info(message: string): void;
39
+ error(message: string): void;
40
+ warn(message: string): void;
41
+ };
42
+ /**
43
+ * @description Configuration for logging behavior
44
+ * @warning Logs are synchronous by default and add overhead — do not use in production unless you override with an async custom logger. Logs are mainly for debugging.
45
+ */
46
+ type LoggerConfig = {
47
+ /**
48
+ * @description Minimum log level. Messages below this level are suppressed.
49
+ * @default "info"
50
+ */
51
+ level?: "info" | "warn" | "error";
52
+ /**
53
+ * @description Whether to log SQL/Mongo queries.
54
+ * @default true
55
+ */
56
+ logQueries?: boolean;
57
+ /**
58
+ * @description Custom logger instance. When provided, replaces the default console logger.
59
+ */
60
+ customLogger?: CustomLogger;
61
+ };
62
+ declare class HysteriaLogger {
63
+ static loggerInstance: CustomLogger;
64
+ static setCustomLogger(customLogger: CustomLogger): void;
65
+ static info(message: string): void;
66
+ static error(message: string | Error): void;
67
+ static warn(message: string): void;
68
+ }
69
+
37
70
  /**
38
71
  * @description Creates a datasource for the selected database type with the provided credentials
39
72
  */
@@ -56,7 +89,7 @@ interface OracleDBDataSourceInput extends CommonDataSourceInput {
56
89
  }
57
90
  interface CommonDataSourceInput {
58
91
  readonly type?: DataSourceType;
59
- readonly logs?: boolean;
92
+ readonly logs?: boolean | LoggerConfig;
60
93
  }
61
94
  interface MongoDataSourceInput$1 extends CommonDataSourceInput {
62
95
  readonly type: "mongo";
@@ -185,9 +218,9 @@ declare class MongoQueryBuilder<T extends Collection> {
185
218
  protected mongoDataSource: MongoDataSource;
186
219
  protected collection: Collection$1<T>;
187
220
  protected model: typeof Collection;
188
- protected logs: boolean;
221
+ protected logs: boolean | LoggerConfig;
189
222
  protected session?: ReturnType<MongoDataSource["startSession"]>;
190
- constructor(model: typeof Collection, mongoDataSource: MongoDataSource, _session?: ReturnType<MongoDataSource["startSession"]>, logs?: boolean);
223
+ constructor(model: typeof Collection, mongoDataSource: MongoDataSource, _session?: ReturnType<MongoDataSource["startSession"]>, logs?: boolean | LoggerConfig);
191
224
  one(options?: OneOptions$1): Promise<T | null>;
192
225
  oneOrFail(options?: OneOptions$1): Promise<T>;
193
226
  many(options?: ManyOptions$1): Promise<T[]>;
@@ -475,7 +508,7 @@ declare abstract class DataSource {
475
508
  password: string;
476
509
  database: string;
477
510
  url: string;
478
- logs: boolean;
511
+ logs: boolean | LoggerConfig;
479
512
  protected constructor(input?: DataSourceInput);
480
513
  protected handleCockroachdbSource(input?: PostgresSqlDataSourceInput): void;
481
514
  protected handlePostgresSource(input?: PostgresSqlDataSourceInput): void;
@@ -507,13 +540,13 @@ type MongoUnrestrictedFindManyOptions<T extends Collection> = UnrestrictedMongoF
507
540
  offset?: number;
508
541
  };
509
542
  declare class CollectionManager<T extends Collection> {
510
- protected logs: boolean;
543
+ protected logs: boolean | LoggerConfig;
511
544
  protected collection: typeof Collection;
512
545
  protected mongoClient: ReturnType<MongoDataSource["getCurrentConnection"]>;
513
546
  protected mongoDataSource: MongoDataSource;
514
547
  protected collectionInstance: MongoClientImport["Collection"]["prototype"];
515
548
  protected session?: ReturnType<MongoDataSource["startSession"]>;
516
- constructor(_collection: typeof Collection, mongoDataSource: MongoDataSource, session?: ReturnType<MongoDataSource["startSession"]>, logs?: boolean);
549
+ constructor(_collection: typeof Collection, mongoDataSource: MongoDataSource, session?: ReturnType<MongoDataSource["startSession"]>, logs?: boolean | LoggerConfig);
517
550
  /**
518
551
  * @description Finds all records that match the input
519
552
  */
@@ -555,10 +588,11 @@ declare class CollectionManager<T extends Collection> {
555
588
  }
556
589
 
557
590
  type MongoClientInstance = InstanceType<MongoClientImport["MongoClient"]>;
591
+
558
592
  interface MongoDataSourceInput {
559
593
  url?: string;
560
594
  options?: MongoConnectionOptions;
561
- logs?: boolean;
595
+ logs?: boolean | LoggerConfig;
562
596
  }
563
597
  declare class MongoDataSource extends DataSource {
564
598
  url: string;
@@ -1389,9 +1423,11 @@ type SeederConfig = {
1389
1423
  */
1390
1424
  type SqlDataSourceInputBase<T extends Record<string, SqlDataSourceModel> = {}, C extends CacheKeys = {}, D extends SqlDataSourceType = SqlDataSourceType> = {
1391
1425
  /**
1392
- * @description Whether to log the sql queries and other debug information
1426
+ * @description Whether to log the sql queries and other debug information. Can be a boolean or a LoggerConfig object for granular control.
1427
+ * @warning Logs are synchronous by default and add overhead — do not use in production unless you override with an async custom logger.
1428
+ * @default false
1393
1429
  */
1394
- readonly logs?: boolean;
1430
+ readonly logs?: boolean | LoggerConfig;
1395
1431
  /**
1396
1432
  * @description The connection policies to use for the sql data source that are not configured in the driverOptions
1397
1433
  */
@@ -1481,7 +1517,7 @@ type UseConnectionInput<D extends SqlDataSourceType = SqlDataSourceType, T exten
1481
1517
  * @description The type of the database to connect to
1482
1518
  */
1483
1519
  readonly type: D;
1484
- readonly logs?: boolean;
1520
+ readonly logs?: boolean | LoggerConfig;
1485
1521
  readonly models?: T;
1486
1522
  readonly driverOptions?: SqlDriverSpecificOptions<D>;
1487
1523
  connectionPolicies?: ConnectionPolicies;
@@ -3317,7 +3353,7 @@ declare abstract class FooterQueryBuilder<T extends Model, S extends Record<stri
3317
3353
  protected offsetNode: OffsetNode | null;
3318
3354
  protected modelColumns: ColumnType[];
3319
3355
  protected modelColumnsMap: Map<string, ColumnType>;
3320
- protected logs: boolean;
3356
+ protected logs: boolean | LoggerConfig;
3321
3357
  protected constructor(model: typeof Model, sqlDataSource: SqlDataSource);
3322
3358
  /**
3323
3359
  * @description Clears the group by query
@@ -3825,6 +3861,27 @@ declare abstract class WhereQueryBuilder<T extends Model, S extends Record<strin
3825
3861
  orWhere<K extends ModelKey<T>>(column: K, value: WhereColumnValue<T, K>): this;
3826
3862
  orWhere(column: `${string}.${string}`, operator: BinaryOperatorType, value: BaseValues): this;
3827
3863
  orWhere(column: `${string}.${string}`, value: BaseValues): this;
3864
+ /**
3865
+ * @description Adds a WHERE condition comparing two columns.
3866
+ */
3867
+ whereColumn<K extends ModelKey<T>>(column: K, referenceColumn: ModelKey<T>): this;
3868
+ whereColumn<K extends ModelKey<T>>(column: K, operator: BinaryOperatorType, referenceColumn: ModelKey<T>): this;
3869
+ whereColumn(column: `${string}.${string}`, referenceColumn: `${string}.${string}`): this;
3870
+ whereColumn(column: `${string}.${string}`, operator: BinaryOperatorType, referenceColumn: `${string}.${string}`): this;
3871
+ /**
3872
+ * @description Adds an AND WHERE condition comparing two columns.
3873
+ */
3874
+ andWhereColumn<K extends ModelKey<T>>(column: K, referenceColumn: ModelKey<T>): this;
3875
+ andWhereColumn<K extends ModelKey<T>>(column: K, operator: BinaryOperatorType, referenceColumn: ModelKey<T>): this;
3876
+ andWhereColumn(column: `${string}.${string}`, referenceColumn: `${string}.${string}`): this;
3877
+ andWhereColumn(column: `${string}.${string}`, operator: BinaryOperatorType, referenceColumn: `${string}.${string}`): this;
3878
+ /**
3879
+ * @description Adds an OR WHERE condition comparing two columns.
3880
+ */
3881
+ orWhereColumn<K extends ModelKey<T>>(column: K, referenceColumn: ModelKey<T>): this;
3882
+ orWhereColumn<K extends ModelKey<T>>(column: K, operator: BinaryOperatorType, referenceColumn: ModelKey<T>): this;
3883
+ orWhereColumn(column: `${string}.${string}`, referenceColumn: `${string}.${string}`): this;
3884
+ orWhereColumn(column: `${string}.${string}`, operator: BinaryOperatorType, referenceColumn: `${string}.${string}`): this;
3828
3885
  /**
3829
3886
  * @description Adds a negated WHERE condition to the query.
3830
3887
  */
@@ -4370,7 +4427,7 @@ type ComposeRawSelect<S extends Record<string, any>, Added extends Record<string
4370
4427
  * @typeParam Columns - The columns being selected
4371
4428
  */
4372
4429
  type ComposeBuildRawSelect<S extends Record<string, any>, Columns extends readonly Selectable[]> = (typeof RAW_SELECT_BRAND extends keyof S ? S : {}) & BuildRawSelectType<Columns>;
4373
- type WhereOnlyQueryBuilder<T extends Model> = Pick<WhereQueryBuilder<T>, "where" | "andWhere" | "orWhere" | "whereNot" | "andWhereNot" | "orWhereNot" | "whereIn" | "andWhereIn" | "orWhereIn" | "whereNotIn" | "andWhereNotIn" | "orWhereNotIn" | "whereBetween" | "andWhereBetween" | "orWhereBetween" | "whereNotBetween" | "andWhereNotBetween" | "orWhereNotBetween" | "whereNull" | "andWhereNull" | "orWhereNull" | "whereNotNull" | "andWhereNotNull" | "orWhereNotNull" | "whereLike" | "andWhereLike" | "orWhereLike" | "whereILike" | "andWhereILike" | "orWhereILike" | "whereNotLike" | "andWhereNotLike" | "orWhereNotLike" | "whereNotILike" | "andWhereNotILike" | "orWhereNotILike" | "whereRegexp" | "andWhereRegexp" | "orWhereRegexp" | "whereNotRegexp" | "andWhereNotRegexp" | "orWhereNotRegexp" | "whereRaw" | "andWhereRaw" | "orWhereRaw" | "whereExists" | "orWhereExists" | "andWhereExists"> & Pick<JsonQueryBuilder<T>, "whereJson" | "andWhereJson" | "orWhereJson" | "whereJsonContains" | "andWhereJsonContains" | "orWhereJsonContains" | "whereJsonNotContains" | "andWhereJsonNotContains" | "orWhereJsonNotContains" | "whereJsonNotContains" | "andWhereJsonNotContains" | "orWhereJsonNotContains" | "whereJsonRaw" | "andWhereJsonRaw" | "orWhereJsonRaw" | "whereJsonNotContains" | "andWhereJsonNotContains" | "orWhereJsonNotContains">;
4430
+ type WhereOnlyQueryBuilder<T extends Model> = Pick<WhereQueryBuilder<T>, "where" | "andWhere" | "orWhere" | "whereNot" | "andWhereNot" | "orWhereNot" | "whereIn" | "andWhereIn" | "orWhereIn" | "whereNotIn" | "andWhereNotIn" | "orWhereNotIn" | "whereBetween" | "andWhereBetween" | "orWhereBetween" | "whereNotBetween" | "andWhereNotBetween" | "orWhereNotBetween" | "whereNull" | "andWhereNull" | "orWhereNull" | "whereNotNull" | "andWhereNotNull" | "orWhereNotNull" | "whereLike" | "andWhereLike" | "orWhereLike" | "whereILike" | "andWhereILike" | "orWhereILike" | "whereNotLike" | "andWhereNotLike" | "orWhereNotLike" | "whereNotILike" | "andWhereNotILike" | "orWhereNotILike" | "whereRegexp" | "andWhereRegexp" | "orWhereRegexp" | "whereNotRegexp" | "andWhereNotRegexp" | "orWhereNotRegexp" | "whereRaw" | "andWhereRaw" | "orWhereRaw" | "whereExists" | "orWhereExists" | "andWhereExists" | "whereNotExists" | "orWhereNotExists" | "andWhereNotExists" | "whereColumn" | "andWhereColumn" | "orWhereColumn"> & Pick<JsonQueryBuilder<T>, "whereJson" | "andWhereJson" | "orWhereJson" | "whereJsonContains" | "andWhereJsonContains" | "orWhereJsonContains" | "whereJsonNotContains" | "andWhereJsonNotContains" | "orWhereJsonNotContains" | "whereJsonNotContains" | "andWhereJsonNotContains" | "orWhereJsonNotContains" | "whereJsonRaw" | "andWhereJsonRaw" | "orWhereJsonRaw" | "whereJsonNotContains" | "andWhereJsonNotContains" | "orWhereJsonNotContains">;
4374
4431
  type RelationRetrieveMethod<P extends any> = P extends any[] ? "many" : "one";
4375
4432
  /**
4376
4433
  * Validates a column string for raw query builder select().
@@ -4953,7 +5010,7 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
4953
5010
  declare class ModelManager<T extends Model> {
4954
5011
  protected sqlDataSource: SqlDataSource;
4955
5012
  protected sqlType: SqlDataSourceType;
4956
- protected logs: boolean;
5013
+ protected logs: boolean | LoggerConfig;
4957
5014
  protected model: typeof Model;
4958
5015
  protected modelInstance: T;
4959
5016
  protected astParser: AstParser;
@@ -5128,7 +5185,7 @@ declare class Transaction {
5128
5185
  * @description If a callback is provided, it will execute the callback and commit or rollback the nested transaction save points based on the callback's success or failure
5129
5186
  */
5130
5187
  nestedTransaction(): Promise<Transaction>;
5131
- nestedTransaction(cb: (trx: Transaction) => Promise<void>): Promise<void>;
5188
+ nestedTransaction<T>(cb: (trx: Transaction) => Promise<T>): Promise<T>;
5132
5189
  /**
5133
5190
  * @description Starts a transaction, automatically handled from the sql data source instance in the `transaction` method
5134
5191
  */
@@ -5446,7 +5503,7 @@ declare class SqlDataSource<D extends SqlDataSourceType = SqlDataSourceType, T e
5446
5503
  * @sqlite ignores the isolation level
5447
5504
  */
5448
5505
  transaction(options?: StartTransactionOptions): Promise<Transaction>;
5449
- transaction(cb: (trx: Transaction) => Promise<void>, options?: StartTransactionOptions): Promise<void>;
5506
+ transaction<T>(cb: (trx: Transaction) => Promise<T>, options?: StartTransactionOptions): Promise<T>;
5450
5507
  /**
5451
5508
  * @description Returns a ModelManager instance for the given model
5452
5509
  */
@@ -7795,9 +7852,9 @@ declare class Schema {
7795
7852
  }
7796
7853
 
7797
7854
  declare abstract class Migration {
7798
- dbType: SqlDataSourceType;
7799
- migrationName: string;
7800
- schema: Schema;
7855
+ readonly dbType: SqlDataSourceType;
7856
+ readonly migrationName: string;
7857
+ readonly schema: Schema;
7801
7858
  constructor(dbType: SqlDataSourceType);
7802
7859
  /**
7803
7860
  * @description This method is called when the migration is to be run
@@ -7841,19 +7898,6 @@ declare class ClientMigrator {
7841
7898
  */
7842
7899
  declare const defineMigrator: (migrationPath: string, sqlDataSourceInput?: SqlDataSource["inputDetails"] | SqlDataSource) => ClientMigrator;
7843
7900
 
7844
- type CustomLogger = {
7845
- info(message: string): void;
7846
- error(message: string): void;
7847
- warn(message: string): void;
7848
- };
7849
- declare class HysteriaLogger {
7850
- static loggerInstance: CustomLogger;
7851
- static setCustomLogger(customLogger: CustomLogger): void;
7852
- static info(message: string): void;
7853
- static error(message: string | Error): void;
7854
- static warn(message: string): void;
7855
- }
7856
-
7857
7901
  /**
7858
7902
  * @description Base class for all seeders
7859
7903
  * @description Provides access to the SqlDataSource instance
@@ -7903,4 +7947,4 @@ declare const generateOpenApiModelWithMetadata: <T extends new () => Model>(mode
7903
7947
  $id?: string;
7904
7948
  }>;
7905
7949
 
7906
- export { type AbstractConstructor, type AdminJsActionOptions, type AdminJsAssets, type AdminJsBranding, type AdminJsInstance, type AdminJsLocale, type AdminJsOptions, type AdminJsPage, type AdminJsPropertyOptions, type AdminJsResourceOptions, type AdminJsSettings, type AnyConstructor, type AsymmetricEncryptionOptions, type BaseModelMethodOptions, type BaseModelRelationType, BaseSeeder, type BigIntFields, type BuildSelectType, type BuildSingleSelectType, type CacheAdapter, type CacheKeys, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnOptions, type ColumnType, type CommonDataSourceInput, type ComposeBuildSelect, type ComposeSelect, type ConnectionPolicies, type Constructor, type DataSourceInput, type DataSourceType, type DateColumnOptions, type DatetimeColumnOptions, type ExcludeMethods, type ExtractColumnName, type ExtractSourceColumn, type FetchHooks, type FindReturnType, type GetColumnType, type GetConnectionReturnType, HysteriaError, InMemoryAdapter, type IncrementFields, type IndexType, type LazyRelationType, type ManyOptions, type ManyToManyOptions, type ManyToManyStringOptions, Migration, type MigrationConfig, type MigrationConfigBase, type MixinColumns, MixinFactory, Model, type ModelDataProperties, type ModelInstanceType, type ModelKey, ModelQueryBuilder, type ModelQueryResult, type ModelRelation, type ModelSelectTuple, type ModelSelectableInput, type ModelWithoutRelations, MongoDataSource, type MongoDataSourceInput$1 as MongoDataSourceInput, type MssqlConnectionInstance, type MssqlDataSourceInput, type MssqlPoolInstance, type MysqlConnectionInstance, type MysqlSqlDataSourceInput, type NotNullableMysqlSqlDataSourceInput, type NotNullableOracleDBDataSourceInput, type NotNullableOracleMssqlDataSourceInput, type NotNullablePostgresSqlDataSourceInput, type NotNullableSqliteDataSourceInput, type NumberModelKey, type OneOptions, type OracleDBDataSourceInput, type OracleDBPoolInstance, type PgPoolClientInstance, type PostgresSqlDataSourceInput, QueryBuilder, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelatedInstance, type RelationQueryBuilderType, type ReplicationType, type ReturningColumns, type ReturningKey, Schema, SchemaBuilder, type SeederConfig, type SelectBrand, type SelectableColumn, type SelectedModel, type SlaveAlgorithm, type SlaveContext, type SqlCloneOptions, SqlDataSource, type SqlDataSourceInput, type SqlDataSourceModel, type SqlDataSourceType, type SqlDriverSpecificOptions, type SqlPoolType, type Sqlite3ConnectionOptions, type SqliteConnectionInstance, type SqliteDataSourceInput, type StartTransactionOptions, type SymmetricEncryptionOptions, type TableFormat, type ThroughModel, type TimestampFields, Transaction, type TransactionExecutionOptions, type TypedPropertyDecorator, type UlidFields, UlidMixin, type UniqueType, type UseCacheReturnType, type UseConnectionInput, type UuidFields, UuidMixin, WriteOperation, type WriteReturnType, belongsTo, bigIntMixin, column, createMixin, createModelFactory, defineMigrator, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, incrementMixin, index, HysteriaLogger as logger, manyToMany, property, RedisDataSource as redis, timestampMixin, ulidMixin, unique, uuidMixin, view, withPerformance };
7950
+ export { type AbstractConstructor, type AdminJsActionOptions, type AdminJsAssets, type AdminJsBranding, type AdminJsInstance, type AdminJsLocale, type AdminJsOptions, type AdminJsPage, type AdminJsPropertyOptions, type AdminJsResourceOptions, type AdminJsSettings, type AnyConstructor, type AsymmetricEncryptionOptions, type BaseModelMethodOptions, type BaseModelRelationType, BaseSeeder, type BigIntFields, type BuildSelectType, type BuildSingleSelectType, type CacheAdapter, type CacheKeys, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnOptions, type ColumnType, type CommonDataSourceInput, type ComposeBuildSelect, type ComposeSelect, type ConnectionPolicies, type Constructor, type CustomLogger, type DataSourceInput, type DataSourceType, type DateColumnOptions, type DatetimeColumnOptions, type ExcludeMethods, type ExtractColumnName, type ExtractSourceColumn, type FetchHooks, type FindReturnType, type GetColumnType, type GetConnectionReturnType, HysteriaError, InMemoryAdapter, type IncrementFields, type IndexType, type LazyRelationType, type LoggerConfig, type ManyOptions, type ManyToManyOptions, type ManyToManyStringOptions, Migration, type MigrationConfig, type MigrationConfigBase, type MixinColumns, MixinFactory, Model, type ModelDataProperties, type ModelInstanceType, type ModelKey, ModelQueryBuilder, type ModelQueryResult, type ModelRelation, type ModelSelectTuple, type ModelSelectableInput, type ModelWithoutRelations, MongoDataSource, type MongoDataSourceInput$1 as MongoDataSourceInput, type MssqlConnectionInstance, type MssqlDataSourceInput, type MssqlPoolInstance, type MysqlConnectionInstance, type MysqlSqlDataSourceInput, type NotNullableMysqlSqlDataSourceInput, type NotNullableOracleDBDataSourceInput, type NotNullableOracleMssqlDataSourceInput, type NotNullablePostgresSqlDataSourceInput, type NotNullableSqliteDataSourceInput, type NumberModelKey, type OneOptions, type OracleDBDataSourceInput, type OracleDBPoolInstance, type PgPoolClientInstance, type PostgresSqlDataSourceInput, QueryBuilder, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelatedInstance, type RelationQueryBuilderType, type ReplicationType, type ReturningColumns, type ReturningKey, Schema, SchemaBuilder, type SeederConfig, type SelectBrand, type SelectableColumn, type SelectedModel, type SlaveAlgorithm, type SlaveContext, type SqlCloneOptions, SqlDataSource, type SqlDataSourceInput, type SqlDataSourceModel, type SqlDataSourceType, type SqlDriverSpecificOptions, type SqlPoolType, type Sqlite3ConnectionOptions, type SqliteConnectionInstance, type SqliteDataSourceInput, type StartTransactionOptions, type SymmetricEncryptionOptions, type TableFormat, type ThroughModel, type TimestampFields, Transaction, type TransactionExecutionOptions, type TypedPropertyDecorator, type UlidFields, UlidMixin, type UniqueType, type UseCacheReturnType, type UseConnectionInput, type UuidFields, UuidMixin, WriteOperation, type WriteReturnType, belongsTo, bigIntMixin, column, createMixin, createModelFactory, defineMigrator, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, incrementMixin, index, HysteriaLogger as logger, manyToMany, property, RedisDataSource as redis, timestampMixin, ulidMixin, unique, uuidMixin, view, withPerformance };