hysteria-orm 10.8.2 → 10.8.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
@@ -5068,18 +5068,17 @@ declare class ModelManager<T extends Model> {
5068
5068
  */
5069
5069
  private executeMssqlMerge;
5070
5070
  /**
5071
- * @description Updates a record, returns the updated record
5072
- * @description Model is retrieved from the database using the primary key regardless of any model hooks
5071
+ * @description Updates a record. When returning is provided, re-fetches and returns the updated record; otherwise returns void.
5073
5072
  * @description Can only be used if the model has a primary key, use a massive update if the model has no primary key
5074
5073
  */
5075
- updateRecord(model: Partial<T>, options?: {
5074
+ updateRecord(pk: string | number, data: Partial<T>, options?: {
5076
5075
  returning?: ModelKey<T>[];
5077
- }): Promise<ModelWithoutRelations<T>>;
5076
+ }): Promise<ModelWithoutRelations<T> | void>;
5078
5077
  /**
5079
5078
  * @description Deletes a record
5080
5079
  * @description Can only be used if the model has a primary key, use a massive delete if the model has no primary key
5081
5080
  */
5082
- deleteRecord(model: T): Promise<void>;
5081
+ deleteRecord(pk: string | number): Promise<void>;
5083
5082
  /**
5084
5083
  * @description Returns a query builder instance
5085
5084
  */
@@ -5687,23 +5686,24 @@ type ModelWithoutRelations<T extends Model> = Pick<Omit<T, "*">, ExcludeRelation
5687
5686
  * This type is used as the return type for:
5688
5687
  * - Static find methods: find, findOne, findOneOrFail, findBy, findOneBy, findOneByPrimaryKey
5689
5688
  * - Static retrieval methods: all, first
5690
- * - Static mutation methods: insert, insertMany, upsert, upsertMany, updateRecord, softDelete
5689
+ * - Static mutation methods: insert, insertMany, upsert, upsertMany, updateRecord, softDelete, save
5691
5690
  * - Static refresh method: refresh
5692
5691
  *
5693
5692
  * @example
5694
5693
  * ```typescript
5695
- * // All these methods return ModelQueryResult<User> (or arrays/nullables thereof)
5694
+ * // Find methods return ModelQueryResult<User> (or arrays/nullables thereof)
5696
5695
  * const user1 = await User.findOne({ where: { id: 1 } });
5697
- * const user2 = await User.findOneOrFail({ where: { id: 1 } });
5698
5696
  * const users = await User.find({});
5699
- * const allUsers = await User.all();
5700
- * const newUser = await User.insert({ name: "John" });
5701
5697
  *
5702
- * // Results are plain data objects - use static methods for operations
5698
+ * // Mutation methods return void by default; use returning for data
5699
+ * await User.insert({ name: "John" }); // void
5700
+ * const newUser = await User.insert({ name: "John" }, { returning: ["*"] }); // User
5701
+ *
5703
5702
  * if (user1) {
5704
- * await User.updateRecord(user1, { name: "Jane" });
5705
- * await User.refresh(user1);
5706
- * await User.deleteRecord(user1);
5703
+ * await User.updateRecord(user1.id, { name: "Jane" }); // void
5704
+ * const updated = await User.updateRecord(user1.id, { name: "Jane" }, { returning: ["*"] }); // User
5705
+ * const refreshed = await User.refresh(user1.id);
5706
+ * await User.deleteRecord(user1.id);
5707
5707
  * }
5708
5708
  * ```
5709
5709
  */
@@ -6240,9 +6240,12 @@ declare abstract class Model<T extends Model<T> = any> extends Entity {
6240
6240
  */
6241
6241
  static findOneByPrimaryKey<T extends Model, S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(this: new () => T | typeof Model, value: string | number, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<FindReturnType<T, S, R> | null>;
6242
6242
  /**
6243
- * @description Refreshes a model from the database, the model must have a primary key defined
6243
+ * @description Retrieves a fresh copy of a record from the database by primary key
6244
+ * @param pk The primary key value of the record to refresh
6245
+ * @param options Optional transaction/connection options
6246
+ * @returns The refreshed model data or null if not found
6244
6247
  */
6245
- static refresh<T extends Model>(this: new () => T | typeof Model, model: T, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<void>;
6248
+ static refresh<T extends Model>(this: new () => T | typeof Model, pk: string | number, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<ModelQueryResult<T> | null>;
6246
6249
  /**
6247
6250
  * @description Saves a new record to the database
6248
6251
  * @warning If not using postgres and the model has no primary key, the model will be saved, but it won't be possible to retrieve it so at that point it will be returned as null, this is not typed as Model | null for type safety reasons
@@ -6286,12 +6289,17 @@ declare abstract class Model<T extends Model<T> = any> extends Entity {
6286
6289
  caseConvention?: CaseConvention;
6287
6290
  }): Promise<void>;
6288
6291
  /**
6289
- * @description Updates a record, returns the updated record
6290
- * @description Model is retrieved from the database using the primary key regardless of any model hooks
6292
+ * @description Updates a record by primary key. By default returns void; when returning is provided, re-fetches and returns the specified columns.
6291
6293
  * @description Can only be used if the model has a primary key, use a massive update if the model has no primary key
6294
+ * @param pk The primary key value of the record to update
6295
+ * @param updatePayload The partial data to update
6296
+ * @param options Optional transaction/connection options and returning columns
6297
+ * @typeParam R - The returning columns (literal tuple for type inference). Defaults to void.
6292
6298
  * @throws {HysteriaError} If the model has no primary key
6293
6299
  */
6294
- static updateRecord<T extends Model>(this: new () => T | typeof Model, modelSqlInstance: Partial<T>, updatePayload?: Partial<ModelWithoutRelations<T>>, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<ModelQueryResult<T>>;
6300
+ static updateRecord<T extends Model, const R extends ReturningColumns<T> = undefined>(this: new () => T | typeof Model, pk: string | number, updatePayload: Partial<ModelWithoutRelations<T>>, options?: Omit<BaseModelMethodOptions, "ignoreHooks"> & {
6301
+ returning?: R;
6302
+ }): Promise<WriteReturnType<T, R>>;
6295
6303
  /**
6296
6304
  * @description Finds the first record or creates a new one if it doesn't exist
6297
6305
  */
@@ -6317,28 +6325,39 @@ declare abstract class Model<T extends Model<T> = any> extends Entity {
6317
6325
  returning?: R;
6318
6326
  }): Promise<WriteReturnType<T, R>[]>;
6319
6327
  /**
6320
- * @description Deletes a record to the database
6328
+ * @description Deletes a record from the database by primary key
6329
+ * @param pk The primary key value of the record to delete
6330
+ * @param options Optional transaction/connection options
6331
+ * @throws {HysteriaError} If the model has no primary key
6321
6332
  */
6322
- static deleteRecord<T extends Model>(this: new () => T | typeof Model, modelSqlInstance: T, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<void>;
6333
+ static deleteRecord<T extends Model>(this: new () => T | typeof Model, pk: string | number, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<void>;
6323
6334
  /**
6324
- * @description Saves (inserts or updates) a model instance to the database
6325
- * @description If the primary key is not set, performs an insert. If set, performs an update.
6326
- * @description After saving, the instance is updated with the result from the database
6327
- * @param modelSqlInstance The model instance to save
6328
- * @param options Optional transaction, connection, or ignoreHooks options
6335
+ * @description Saves (inserts or updates) model data to the database. By default returns void; when returning is provided, returns the specified columns.
6336
+ * @description If the primary key is present in the data, performs an update. If not, performs an insert.
6337
+ * @param modelData The data to save
6338
+ * @param options Optional transaction, connection options and returning columns
6339
+ * @typeParam R - The returning columns (literal tuple for type inference). Defaults to void.
6329
6340
  * @throws {HysteriaError} If the model has no primary key defined
6330
6341
  */
6331
- static save<T extends Model>(this: new () => T | typeof Model, modelSqlInstance: Partial<T>, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<ModelQueryResult<T>>;
6342
+ static save<T extends Model, const R extends ReturningColumns<T> = undefined>(this: new () => T | typeof Model, modelData: Partial<ModelWithoutRelations<T>>, options?: Omit<BaseModelMethodOptions, "ignoreHooks"> & {
6343
+ returning?: R;
6344
+ }): Promise<WriteReturnType<T, R>>;
6332
6345
  /**
6333
- * @description Soft Deletes a record to the database
6346
+ * @description Soft Deletes a record by primary key. By default returns void; when returning is provided, returns the specified columns.
6334
6347
  * @description default column: deletedAt
6335
6348
  * @description default value: The current date and time in UTC timezone in the format "YYYY-MM-DD HH:mm:ss"
6336
6349
  * @description You can override the column and value by providing the column and value on the static properties of the model `softDeleteColumn` and `softDeleteValue`
6350
+ * @param pk The primary key value of the record to soft delete
6351
+ * @param softDeleteOptions Optional column and value overrides
6352
+ * @param options Optional transaction/connection options and returning columns
6353
+ * @typeParam R - The returning columns (literal tuple for type inference). Defaults to void.
6337
6354
  */
6338
- static softDelete<T extends Model>(this: new () => T | typeof Model, modelSqlInstance: T, softDeleteOptions?: {
6355
+ static softDelete<T extends Model, const R extends ReturningColumns<T> = undefined>(this: new () => T | typeof Model, pk: string | number, softDeleteOptions?: {
6339
6356
  column?: ModelKey<T>;
6340
6357
  value?: string | number | boolean | Date;
6341
- }, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<ModelQueryResult<T>>;
6358
+ }, options?: Omit<BaseModelMethodOptions, "ignoreHooks"> & {
6359
+ returning?: R;
6360
+ }): Promise<WriteReturnType<T, R>>;
6342
6361
  /**
6343
6362
  * @description Truncates the table for the given model
6344
6363
  */
@@ -6535,8 +6554,17 @@ declare abstract class Model<T extends Model<T> = any> extends Entity {
6535
6554
  */
6536
6555
  interface ColumnDef<T = unknown> {
6537
6556
  readonly _phantom: T;
6557
+ readonly _isPrimary?: boolean;
6538
6558
  readonly _apply: (target: Object, propertyKey: string) => void;
6539
6559
  }
6560
+ /**
6561
+ * A column descriptor marked as a primary key.
6562
+ * Used by `col.primary()`, `col.increment()`, and `col.bigIncrement()` to
6563
+ * carry PK type information for `defineModel` type inference.
6564
+ */
6565
+ interface PrimaryColumnDef<T = unknown> extends ColumnDef<T> {
6566
+ readonly _isPrimary: true;
6567
+ }
6540
6568
  /**
6541
6569
  * Phantom-typed descriptor for a model relation.
6542
6570
  * `T` carries the TypeScript type the relation resolves to at the instance level.
@@ -6624,7 +6652,7 @@ interface ColNamespace {
6624
6652
  * col.primary<number>({ nullable: false })
6625
6653
  * ```
6626
6654
  */
6627
- primary<T = string | number>(options?: ColPrimaryOptions & TypedSerialize<T> & TypedPrepare<T>): ColumnDef<T>;
6655
+ primary<T = string | number>(options?: ColPrimaryOptions & TypedSerialize<T> & TypedPrepare<T>): PrimaryColumnDef<T>;
6628
6656
  /**
6629
6657
  * VARCHAR column. Accepts an optional `length` option.
6630
6658
  * Type: `string` (nullable-aware).
@@ -6668,12 +6696,12 @@ interface ColNamespace {
6668
6696
  * Auto-incrementing integer primary key. Always non-nullable.
6669
6697
  * Type: `number`. Only `prepare` is exposed.
6670
6698
  */
6671
- increment(options?: ColIncrementOptions & TypedPrepare<number>): ColumnDef<number>;
6699
+ increment(options?: ColIncrementOptions & TypedPrepare<number>): PrimaryColumnDef<number>;
6672
6700
  /**
6673
6701
  * Auto-incrementing bigint primary key. Always non-nullable.
6674
6702
  * Type: `number`. Only `prepare` is exposed.
6675
6703
  */
6676
- bigIncrement(options?: ColBigIncrementOptions & TypedPrepare<number>): ColumnDef<number>;
6704
+ bigIncrement(options?: ColBigIncrementOptions & TypedPrepare<number>): PrimaryColumnDef<number>;
6677
6705
  /**
6678
6706
  * Boolean column.
6679
6707
  * Type: `boolean` (nullable-aware). No `serialize` or `prepare` exposed.
@@ -6949,6 +6977,17 @@ type DefineModelOptions<K extends string = string> = {
6949
6977
  softDeleteColumn?: K;
6950
6978
  softDeleteValue?: boolean | string;
6951
6979
  };
6980
+ /**
6981
+ * Extracts the primary key column type from a columns definition.
6982
+ * Looks for columns defined with `PrimaryColumnDef` (col.primary, col.increment, col.bigIncrement).
6983
+ * Falls back to `string | number` if no PK column is found.
6984
+ */
6985
+ type ExtractPKType<C extends Record<string, ColumnDef>> = {
6986
+ [K in keyof C]: C[K] extends PrimaryColumnDef<infer T> ? T : never;
6987
+ }[keyof C];
6988
+ type InferPK<C extends Record<string, ColumnDef>> = [
6989
+ ExtractPKType<C>
6990
+ ] extends [never] ? string | number : ExtractPKType<C>;
6952
6991
  type InferColumns<C extends Record<string, ColumnDef>> = {
6953
6992
  [K in keyof C]: C[K] extends ColumnDef<infer T> ? T : never;
6954
6993
  };
@@ -6982,6 +7021,11 @@ type ModelDefinition<C extends Record<string, ColumnDef> = Record<string, Column
6982
7021
  type ConcreteModelStatics = {
6983
7022
  [K in keyof typeof Model]: (typeof Model)[K];
6984
7023
  };
7024
+ /**
7025
+ * Static methods that may have narrowed PK types in DefinedModel.
7026
+ * Excluded from structural checks in AnyModelConstructor.
7027
+ */
7028
+ type PKNarrowedMethods = "updateRecord" | "deleteRecord" | "softDelete" | "save" | "refresh";
6985
7029
  /**
6986
7030
  * Union type that accepts both decorator-based model classes (`typeof Model`
6987
7031
  * subclasses) and programmatic models created via `defineModel`.
@@ -6989,7 +7033,7 @@ type ConcreteModelStatics = {
6989
7033
  * Use this instead of `typeof Model` in any user-facing API that should
6990
7034
  * accept either kind of model.
6991
7035
  */
6992
- type AnyModelConstructor = typeof Model | (ConcreteModelStatics & (new (...args: any[]) => Model));
7036
+ type AnyModelConstructor = typeof Model | (Omit<ConcreteModelStatics, PKNarrowedMethods> & (new (...args: any[]) => Model));
6993
7037
  /**
6994
7038
  * The return type of `defineModel` – a concrete Model constructor whose
6995
7039
  * instances carry the inferred column + relation properties.
@@ -6997,7 +7041,27 @@ type AnyModelConstructor = typeof Model | (ConcreteModelStatics & (new (...args:
6997
7041
  * Uses a mapped type over `typeof Model` so the abstract flag is stripped,
6998
7042
  * making the result instantiable while keeping all public static members.
6999
7043
  */
7000
- type DefinedModel<C extends Record<string, ColumnDef>, R extends Record<string, RelationDef>> = ConcreteModelStatics & {
7044
+ /**
7045
+ * Overrides for static methods that accept a primary key parameter.
7046
+ * Narrows the PK type from `string | number` to the actual inferred PK type.
7047
+ */
7048
+ type DefinedModelPKOverrides<C extends Record<string, ColumnDef>, M extends Model> = {
7049
+ updateRecord<const R extends ReturningColumns<M> = undefined>(pk: InferPK<C>, updatePayload: Partial<ModelWithoutRelations<M>>, options?: Omit<BaseModelMethodOptions, "ignoreHooks"> & {
7050
+ returning?: R;
7051
+ }): Promise<WriteReturnType<M, R>>;
7052
+ deleteRecord(pk: InferPK<C>, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<void>;
7053
+ softDelete<const R extends ReturningColumns<M> = undefined>(pk: InferPK<C>, softDeleteOptions?: {
7054
+ column?: ModelKey<M>;
7055
+ value?: string | number | boolean | Date;
7056
+ }, options?: Omit<BaseModelMethodOptions, "ignoreHooks"> & {
7057
+ returning?: R;
7058
+ }): Promise<WriteReturnType<M, R>>;
7059
+ save<const R extends ReturningColumns<M> = undefined>(modelData: Partial<ModelWithoutRelations<M>>, options?: Omit<BaseModelMethodOptions, "ignoreHooks"> & {
7060
+ returning?: R;
7061
+ }): Promise<WriteReturnType<M, R>>;
7062
+ refresh(pk: InferPK<C>, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<ModelQueryResult<M> | null>;
7063
+ };
7064
+ type DefinedModel<C extends Record<string, ColumnDef>, R extends Record<string, RelationDef>> = Omit<ConcreteModelStatics, PKNarrowedMethods> & DefinedModelPKOverrides<C, InferModel<C, R> & Model> & {
7001
7065
  new (): InferModel<C, R> & Model;
7002
7066
  };
7003
7067
 
@@ -8497,4 +8561,4 @@ declare const generateOpenApiModelWithMetadata: <T extends new () => Model>(mode
8497
8561
  $id?: string;
8498
8562
  }>;
8499
8563
 
8500
- 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 AnyModelConstructor, type AsymmetricEncryptionOptions, type BaseModelMethodOptions, type BaseModelRelationType, BaseSeeder, type BigIntFields, type BuildSelectType, type BuildSingleSelectType, type CacheAdapter, type CacheKeys, type CheckType, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnDef, 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 DefinedModel, 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 NullableColumn, type NumberModelKey, type OneOptions, type OracleDBDataSourceInput, type OracleDBPoolInstance, type PgPoolClientInstance, type PostgresSqlDataSourceInput, QueryBuilder, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelModelCallback, type RelatedInstance, type RelationDef, type RelationNullableOption, 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 TypedPrepare, type TypedPropertyDecorator, type TypedSerialize, type UlidFields, UlidMixin, type UniqueType, type UseCacheReturnType, type UseConnectionInput, type UuidFields, UuidMixin, WriteOperation, type WriteReturnType, belongsTo, bigIntMixin, check, col, column, createMixin, createModelFactory, defineMigrator, defineModel, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getChecks, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, incrementMixin, index, HysteriaLogger as logger, manyToMany, property, RedisDataSource as redis, rel, timestampMixin, ulidMixin, unique, uuidMixin, view, withPerformance };
8564
+ 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 AnyModelConstructor, type AsymmetricEncryptionOptions, type BaseModelMethodOptions, type BaseModelRelationType, BaseSeeder, type BigIntFields, type BuildSelectType, type BuildSingleSelectType, type CacheAdapter, type CacheKeys, type CheckType, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnDef, 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 DefinedModel, type ExcludeMethods, type ExtractColumnName, type ExtractSourceColumn, type FetchHooks, type FindReturnType, type GetColumnType, type GetConnectionReturnType, HysteriaError, InMemoryAdapter, type IncrementFields, type IndexType, type InferPK, 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 NullableColumn, type NumberModelKey, type OneOptions, type OracleDBDataSourceInput, type OracleDBPoolInstance, type PgPoolClientInstance, type PostgresSqlDataSourceInput, type PrimaryColumnDef, QueryBuilder, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelModelCallback, type RelatedInstance, type RelationDef, type RelationNullableOption, 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 TypedPrepare, type TypedPropertyDecorator, type TypedSerialize, type UlidFields, UlidMixin, type UniqueType, type UseCacheReturnType, type UseConnectionInput, type UuidFields, UuidMixin, WriteOperation, type WriteReturnType, belongsTo, bigIntMixin, check, col, column, createMixin, createModelFactory, defineMigrator, defineModel, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getChecks, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, incrementMixin, index, HysteriaLogger as logger, manyToMany, property, RedisDataSource as redis, rel, timestampMixin, ulidMixin, unique, uuidMixin, view, withPerformance };
package/lib/index.d.ts CHANGED
@@ -5068,18 +5068,17 @@ declare class ModelManager<T extends Model> {
5068
5068
  */
5069
5069
  private executeMssqlMerge;
5070
5070
  /**
5071
- * @description Updates a record, returns the updated record
5072
- * @description Model is retrieved from the database using the primary key regardless of any model hooks
5071
+ * @description Updates a record. When returning is provided, re-fetches and returns the updated record; otherwise returns void.
5073
5072
  * @description Can only be used if the model has a primary key, use a massive update if the model has no primary key
5074
5073
  */
5075
- updateRecord(model: Partial<T>, options?: {
5074
+ updateRecord(pk: string | number, data: Partial<T>, options?: {
5076
5075
  returning?: ModelKey<T>[];
5077
- }): Promise<ModelWithoutRelations<T>>;
5076
+ }): Promise<ModelWithoutRelations<T> | void>;
5078
5077
  /**
5079
5078
  * @description Deletes a record
5080
5079
  * @description Can only be used if the model has a primary key, use a massive delete if the model has no primary key
5081
5080
  */
5082
- deleteRecord(model: T): Promise<void>;
5081
+ deleteRecord(pk: string | number): Promise<void>;
5083
5082
  /**
5084
5083
  * @description Returns a query builder instance
5085
5084
  */
@@ -5687,23 +5686,24 @@ type ModelWithoutRelations<T extends Model> = Pick<Omit<T, "*">, ExcludeRelation
5687
5686
  * This type is used as the return type for:
5688
5687
  * - Static find methods: find, findOne, findOneOrFail, findBy, findOneBy, findOneByPrimaryKey
5689
5688
  * - Static retrieval methods: all, first
5690
- * - Static mutation methods: insert, insertMany, upsert, upsertMany, updateRecord, softDelete
5689
+ * - Static mutation methods: insert, insertMany, upsert, upsertMany, updateRecord, softDelete, save
5691
5690
  * - Static refresh method: refresh
5692
5691
  *
5693
5692
  * @example
5694
5693
  * ```typescript
5695
- * // All these methods return ModelQueryResult<User> (or arrays/nullables thereof)
5694
+ * // Find methods return ModelQueryResult<User> (or arrays/nullables thereof)
5696
5695
  * const user1 = await User.findOne({ where: { id: 1 } });
5697
- * const user2 = await User.findOneOrFail({ where: { id: 1 } });
5698
5696
  * const users = await User.find({});
5699
- * const allUsers = await User.all();
5700
- * const newUser = await User.insert({ name: "John" });
5701
5697
  *
5702
- * // Results are plain data objects - use static methods for operations
5698
+ * // Mutation methods return void by default; use returning for data
5699
+ * await User.insert({ name: "John" }); // void
5700
+ * const newUser = await User.insert({ name: "John" }, { returning: ["*"] }); // User
5701
+ *
5703
5702
  * if (user1) {
5704
- * await User.updateRecord(user1, { name: "Jane" });
5705
- * await User.refresh(user1);
5706
- * await User.deleteRecord(user1);
5703
+ * await User.updateRecord(user1.id, { name: "Jane" }); // void
5704
+ * const updated = await User.updateRecord(user1.id, { name: "Jane" }, { returning: ["*"] }); // User
5705
+ * const refreshed = await User.refresh(user1.id);
5706
+ * await User.deleteRecord(user1.id);
5707
5707
  * }
5708
5708
  * ```
5709
5709
  */
@@ -6240,9 +6240,12 @@ declare abstract class Model<T extends Model<T> = any> extends Entity {
6240
6240
  */
6241
6241
  static findOneByPrimaryKey<T extends Model, S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(this: new () => T | typeof Model, value: string | number, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<FindReturnType<T, S, R> | null>;
6242
6242
  /**
6243
- * @description Refreshes a model from the database, the model must have a primary key defined
6243
+ * @description Retrieves a fresh copy of a record from the database by primary key
6244
+ * @param pk The primary key value of the record to refresh
6245
+ * @param options Optional transaction/connection options
6246
+ * @returns The refreshed model data or null if not found
6244
6247
  */
6245
- static refresh<T extends Model>(this: new () => T | typeof Model, model: T, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<void>;
6248
+ static refresh<T extends Model>(this: new () => T | typeof Model, pk: string | number, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<ModelQueryResult<T> | null>;
6246
6249
  /**
6247
6250
  * @description Saves a new record to the database
6248
6251
  * @warning If not using postgres and the model has no primary key, the model will be saved, but it won't be possible to retrieve it so at that point it will be returned as null, this is not typed as Model | null for type safety reasons
@@ -6286,12 +6289,17 @@ declare abstract class Model<T extends Model<T> = any> extends Entity {
6286
6289
  caseConvention?: CaseConvention;
6287
6290
  }): Promise<void>;
6288
6291
  /**
6289
- * @description Updates a record, returns the updated record
6290
- * @description Model is retrieved from the database using the primary key regardless of any model hooks
6292
+ * @description Updates a record by primary key. By default returns void; when returning is provided, re-fetches and returns the specified columns.
6291
6293
  * @description Can only be used if the model has a primary key, use a massive update if the model has no primary key
6294
+ * @param pk The primary key value of the record to update
6295
+ * @param updatePayload The partial data to update
6296
+ * @param options Optional transaction/connection options and returning columns
6297
+ * @typeParam R - The returning columns (literal tuple for type inference). Defaults to void.
6292
6298
  * @throws {HysteriaError} If the model has no primary key
6293
6299
  */
6294
- static updateRecord<T extends Model>(this: new () => T | typeof Model, modelSqlInstance: Partial<T>, updatePayload?: Partial<ModelWithoutRelations<T>>, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<ModelQueryResult<T>>;
6300
+ static updateRecord<T extends Model, const R extends ReturningColumns<T> = undefined>(this: new () => T | typeof Model, pk: string | number, updatePayload: Partial<ModelWithoutRelations<T>>, options?: Omit<BaseModelMethodOptions, "ignoreHooks"> & {
6301
+ returning?: R;
6302
+ }): Promise<WriteReturnType<T, R>>;
6295
6303
  /**
6296
6304
  * @description Finds the first record or creates a new one if it doesn't exist
6297
6305
  */
@@ -6317,28 +6325,39 @@ declare abstract class Model<T extends Model<T> = any> extends Entity {
6317
6325
  returning?: R;
6318
6326
  }): Promise<WriteReturnType<T, R>[]>;
6319
6327
  /**
6320
- * @description Deletes a record to the database
6328
+ * @description Deletes a record from the database by primary key
6329
+ * @param pk The primary key value of the record to delete
6330
+ * @param options Optional transaction/connection options
6331
+ * @throws {HysteriaError} If the model has no primary key
6321
6332
  */
6322
- static deleteRecord<T extends Model>(this: new () => T | typeof Model, modelSqlInstance: T, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<void>;
6333
+ static deleteRecord<T extends Model>(this: new () => T | typeof Model, pk: string | number, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<void>;
6323
6334
  /**
6324
- * @description Saves (inserts or updates) a model instance to the database
6325
- * @description If the primary key is not set, performs an insert. If set, performs an update.
6326
- * @description After saving, the instance is updated with the result from the database
6327
- * @param modelSqlInstance The model instance to save
6328
- * @param options Optional transaction, connection, or ignoreHooks options
6335
+ * @description Saves (inserts or updates) model data to the database. By default returns void; when returning is provided, returns the specified columns.
6336
+ * @description If the primary key is present in the data, performs an update. If not, performs an insert.
6337
+ * @param modelData The data to save
6338
+ * @param options Optional transaction, connection options and returning columns
6339
+ * @typeParam R - The returning columns (literal tuple for type inference). Defaults to void.
6329
6340
  * @throws {HysteriaError} If the model has no primary key defined
6330
6341
  */
6331
- static save<T extends Model>(this: new () => T | typeof Model, modelSqlInstance: Partial<T>, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<ModelQueryResult<T>>;
6342
+ static save<T extends Model, const R extends ReturningColumns<T> = undefined>(this: new () => T | typeof Model, modelData: Partial<ModelWithoutRelations<T>>, options?: Omit<BaseModelMethodOptions, "ignoreHooks"> & {
6343
+ returning?: R;
6344
+ }): Promise<WriteReturnType<T, R>>;
6332
6345
  /**
6333
- * @description Soft Deletes a record to the database
6346
+ * @description Soft Deletes a record by primary key. By default returns void; when returning is provided, returns the specified columns.
6334
6347
  * @description default column: deletedAt
6335
6348
  * @description default value: The current date and time in UTC timezone in the format "YYYY-MM-DD HH:mm:ss"
6336
6349
  * @description You can override the column and value by providing the column and value on the static properties of the model `softDeleteColumn` and `softDeleteValue`
6350
+ * @param pk The primary key value of the record to soft delete
6351
+ * @param softDeleteOptions Optional column and value overrides
6352
+ * @param options Optional transaction/connection options and returning columns
6353
+ * @typeParam R - The returning columns (literal tuple for type inference). Defaults to void.
6337
6354
  */
6338
- static softDelete<T extends Model>(this: new () => T | typeof Model, modelSqlInstance: T, softDeleteOptions?: {
6355
+ static softDelete<T extends Model, const R extends ReturningColumns<T> = undefined>(this: new () => T | typeof Model, pk: string | number, softDeleteOptions?: {
6339
6356
  column?: ModelKey<T>;
6340
6357
  value?: string | number | boolean | Date;
6341
- }, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<ModelQueryResult<T>>;
6358
+ }, options?: Omit<BaseModelMethodOptions, "ignoreHooks"> & {
6359
+ returning?: R;
6360
+ }): Promise<WriteReturnType<T, R>>;
6342
6361
  /**
6343
6362
  * @description Truncates the table for the given model
6344
6363
  */
@@ -6535,8 +6554,17 @@ declare abstract class Model<T extends Model<T> = any> extends Entity {
6535
6554
  */
6536
6555
  interface ColumnDef<T = unknown> {
6537
6556
  readonly _phantom: T;
6557
+ readonly _isPrimary?: boolean;
6538
6558
  readonly _apply: (target: Object, propertyKey: string) => void;
6539
6559
  }
6560
+ /**
6561
+ * A column descriptor marked as a primary key.
6562
+ * Used by `col.primary()`, `col.increment()`, and `col.bigIncrement()` to
6563
+ * carry PK type information for `defineModel` type inference.
6564
+ */
6565
+ interface PrimaryColumnDef<T = unknown> extends ColumnDef<T> {
6566
+ readonly _isPrimary: true;
6567
+ }
6540
6568
  /**
6541
6569
  * Phantom-typed descriptor for a model relation.
6542
6570
  * `T` carries the TypeScript type the relation resolves to at the instance level.
@@ -6624,7 +6652,7 @@ interface ColNamespace {
6624
6652
  * col.primary<number>({ nullable: false })
6625
6653
  * ```
6626
6654
  */
6627
- primary<T = string | number>(options?: ColPrimaryOptions & TypedSerialize<T> & TypedPrepare<T>): ColumnDef<T>;
6655
+ primary<T = string | number>(options?: ColPrimaryOptions & TypedSerialize<T> & TypedPrepare<T>): PrimaryColumnDef<T>;
6628
6656
  /**
6629
6657
  * VARCHAR column. Accepts an optional `length` option.
6630
6658
  * Type: `string` (nullable-aware).
@@ -6668,12 +6696,12 @@ interface ColNamespace {
6668
6696
  * Auto-incrementing integer primary key. Always non-nullable.
6669
6697
  * Type: `number`. Only `prepare` is exposed.
6670
6698
  */
6671
- increment(options?: ColIncrementOptions & TypedPrepare<number>): ColumnDef<number>;
6699
+ increment(options?: ColIncrementOptions & TypedPrepare<number>): PrimaryColumnDef<number>;
6672
6700
  /**
6673
6701
  * Auto-incrementing bigint primary key. Always non-nullable.
6674
6702
  * Type: `number`. Only `prepare` is exposed.
6675
6703
  */
6676
- bigIncrement(options?: ColBigIncrementOptions & TypedPrepare<number>): ColumnDef<number>;
6704
+ bigIncrement(options?: ColBigIncrementOptions & TypedPrepare<number>): PrimaryColumnDef<number>;
6677
6705
  /**
6678
6706
  * Boolean column.
6679
6707
  * Type: `boolean` (nullable-aware). No `serialize` or `prepare` exposed.
@@ -6949,6 +6977,17 @@ type DefineModelOptions<K extends string = string> = {
6949
6977
  softDeleteColumn?: K;
6950
6978
  softDeleteValue?: boolean | string;
6951
6979
  };
6980
+ /**
6981
+ * Extracts the primary key column type from a columns definition.
6982
+ * Looks for columns defined with `PrimaryColumnDef` (col.primary, col.increment, col.bigIncrement).
6983
+ * Falls back to `string | number` if no PK column is found.
6984
+ */
6985
+ type ExtractPKType<C extends Record<string, ColumnDef>> = {
6986
+ [K in keyof C]: C[K] extends PrimaryColumnDef<infer T> ? T : never;
6987
+ }[keyof C];
6988
+ type InferPK<C extends Record<string, ColumnDef>> = [
6989
+ ExtractPKType<C>
6990
+ ] extends [never] ? string | number : ExtractPKType<C>;
6952
6991
  type InferColumns<C extends Record<string, ColumnDef>> = {
6953
6992
  [K in keyof C]: C[K] extends ColumnDef<infer T> ? T : never;
6954
6993
  };
@@ -6982,6 +7021,11 @@ type ModelDefinition<C extends Record<string, ColumnDef> = Record<string, Column
6982
7021
  type ConcreteModelStatics = {
6983
7022
  [K in keyof typeof Model]: (typeof Model)[K];
6984
7023
  };
7024
+ /**
7025
+ * Static methods that may have narrowed PK types in DefinedModel.
7026
+ * Excluded from structural checks in AnyModelConstructor.
7027
+ */
7028
+ type PKNarrowedMethods = "updateRecord" | "deleteRecord" | "softDelete" | "save" | "refresh";
6985
7029
  /**
6986
7030
  * Union type that accepts both decorator-based model classes (`typeof Model`
6987
7031
  * subclasses) and programmatic models created via `defineModel`.
@@ -6989,7 +7033,7 @@ type ConcreteModelStatics = {
6989
7033
  * Use this instead of `typeof Model` in any user-facing API that should
6990
7034
  * accept either kind of model.
6991
7035
  */
6992
- type AnyModelConstructor = typeof Model | (ConcreteModelStatics & (new (...args: any[]) => Model));
7036
+ type AnyModelConstructor = typeof Model | (Omit<ConcreteModelStatics, PKNarrowedMethods> & (new (...args: any[]) => Model));
6993
7037
  /**
6994
7038
  * The return type of `defineModel` – a concrete Model constructor whose
6995
7039
  * instances carry the inferred column + relation properties.
@@ -6997,7 +7041,27 @@ type AnyModelConstructor = typeof Model | (ConcreteModelStatics & (new (...args:
6997
7041
  * Uses a mapped type over `typeof Model` so the abstract flag is stripped,
6998
7042
  * making the result instantiable while keeping all public static members.
6999
7043
  */
7000
- type DefinedModel<C extends Record<string, ColumnDef>, R extends Record<string, RelationDef>> = ConcreteModelStatics & {
7044
+ /**
7045
+ * Overrides for static methods that accept a primary key parameter.
7046
+ * Narrows the PK type from `string | number` to the actual inferred PK type.
7047
+ */
7048
+ type DefinedModelPKOverrides<C extends Record<string, ColumnDef>, M extends Model> = {
7049
+ updateRecord<const R extends ReturningColumns<M> = undefined>(pk: InferPK<C>, updatePayload: Partial<ModelWithoutRelations<M>>, options?: Omit<BaseModelMethodOptions, "ignoreHooks"> & {
7050
+ returning?: R;
7051
+ }): Promise<WriteReturnType<M, R>>;
7052
+ deleteRecord(pk: InferPK<C>, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<void>;
7053
+ softDelete<const R extends ReturningColumns<M> = undefined>(pk: InferPK<C>, softDeleteOptions?: {
7054
+ column?: ModelKey<M>;
7055
+ value?: string | number | boolean | Date;
7056
+ }, options?: Omit<BaseModelMethodOptions, "ignoreHooks"> & {
7057
+ returning?: R;
7058
+ }): Promise<WriteReturnType<M, R>>;
7059
+ save<const R extends ReturningColumns<M> = undefined>(modelData: Partial<ModelWithoutRelations<M>>, options?: Omit<BaseModelMethodOptions, "ignoreHooks"> & {
7060
+ returning?: R;
7061
+ }): Promise<WriteReturnType<M, R>>;
7062
+ refresh(pk: InferPK<C>, options?: Omit<BaseModelMethodOptions, "ignoreHooks">): Promise<ModelQueryResult<M> | null>;
7063
+ };
7064
+ type DefinedModel<C extends Record<string, ColumnDef>, R extends Record<string, RelationDef>> = Omit<ConcreteModelStatics, PKNarrowedMethods> & DefinedModelPKOverrides<C, InferModel<C, R> & Model> & {
7001
7065
  new (): InferModel<C, R> & Model;
7002
7066
  };
7003
7067
 
@@ -8497,4 +8561,4 @@ declare const generateOpenApiModelWithMetadata: <T extends new () => Model>(mode
8497
8561
  $id?: string;
8498
8562
  }>;
8499
8563
 
8500
- 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 AnyModelConstructor, type AsymmetricEncryptionOptions, type BaseModelMethodOptions, type BaseModelRelationType, BaseSeeder, type BigIntFields, type BuildSelectType, type BuildSingleSelectType, type CacheAdapter, type CacheKeys, type CheckType, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnDef, 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 DefinedModel, 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 NullableColumn, type NumberModelKey, type OneOptions, type OracleDBDataSourceInput, type OracleDBPoolInstance, type PgPoolClientInstance, type PostgresSqlDataSourceInput, QueryBuilder, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelModelCallback, type RelatedInstance, type RelationDef, type RelationNullableOption, 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 TypedPrepare, type TypedPropertyDecorator, type TypedSerialize, type UlidFields, UlidMixin, type UniqueType, type UseCacheReturnType, type UseConnectionInput, type UuidFields, UuidMixin, WriteOperation, type WriteReturnType, belongsTo, bigIntMixin, check, col, column, createMixin, createModelFactory, defineMigrator, defineModel, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getChecks, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, incrementMixin, index, HysteriaLogger as logger, manyToMany, property, RedisDataSource as redis, rel, timestampMixin, ulidMixin, unique, uuidMixin, view, withPerformance };
8564
+ 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 AnyModelConstructor, type AsymmetricEncryptionOptions, type BaseModelMethodOptions, type BaseModelRelationType, BaseSeeder, type BigIntFields, type BuildSelectType, type BuildSingleSelectType, type CacheAdapter, type CacheKeys, type CheckType, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnDef, 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 DefinedModel, type ExcludeMethods, type ExtractColumnName, type ExtractSourceColumn, type FetchHooks, type FindReturnType, type GetColumnType, type GetConnectionReturnType, HysteriaError, InMemoryAdapter, type IncrementFields, type IndexType, type InferPK, 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 NullableColumn, type NumberModelKey, type OneOptions, type OracleDBDataSourceInput, type OracleDBPoolInstance, type PgPoolClientInstance, type PostgresSqlDataSourceInput, type PrimaryColumnDef, QueryBuilder, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelModelCallback, type RelatedInstance, type RelationDef, type RelationNullableOption, 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 TypedPrepare, type TypedPropertyDecorator, type TypedSerialize, type UlidFields, UlidMixin, type UniqueType, type UseCacheReturnType, type UseConnectionInput, type UuidFields, UuidMixin, WriteOperation, type WriteReturnType, belongsTo, bigIntMixin, check, col, column, createMixin, createModelFactory, defineMigrator, defineModel, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getChecks, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, incrementMixin, index, HysteriaLogger as logger, manyToMany, property, RedisDataSource as redis, rel, timestampMixin, ulidMixin, unique, uuidMixin, view, withPerformance };