hysteria-orm 10.8.3 → 10.8.4

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
@@ -3282,8 +3282,8 @@ type ColumnOptions = {
3282
3282
  */
3283
3283
  nullable?: boolean;
3284
3284
  /**
3285
- * @description The default value for the column in the database
3286
- * @migration Only affects auto-generated migrations
3285
+ * @description The default value for the column in the database.
3286
+ * @migration Only affects auto-generated migrations (CREATE TABLE / ALTER TABLE). Does NOT set a default value during insert operations — use `prepare` for that.
3287
3287
  */
3288
3288
  default?: string | number | null | boolean;
3289
3289
  } &
@@ -6573,31 +6573,31 @@ interface RelationDef<T = any> {
6573
6573
  readonly _phantom: T;
6574
6574
  readonly _apply: (target: Object, propertyKey: string) => void;
6575
6575
  }
6576
- type ColOptions = Omit<ColumnOptions, "primaryKey" | "serialize" | "prepare">;
6577
- type ColPrimaryOptions = Omit<ColumnOptions, "primaryKey" | "serialize" | "prepare">;
6578
- type ColStringOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare"> & {
6576
+ type ColOptions = Omit<ColumnOptions, "primaryKey" | "serialize" | "prepare" | "default">;
6577
+ type ColPrimaryOptions = Omit<ColumnOptions, "primaryKey" | "serialize" | "prepare" | "default">;
6578
+ type ColStringOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default"> & {
6579
6579
  length?: number;
6580
6580
  };
6581
- type ColTextOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare">;
6582
- type ColIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare">;
6583
- type ColBigIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare">;
6584
- type ColFloatOptions = Omit<ColumnOptions, "serialize" | "prepare">;
6585
- type ColDecimalOptions = Omit<ColumnOptions, "serialize" | "prepare"> & {
6581
+ type ColTextOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6582
+ type ColIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default">;
6583
+ type ColBigIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default">;
6584
+ type ColFloatOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default">;
6585
+ type ColDecimalOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default"> & {
6586
6586
  precision?: number;
6587
6587
  scale?: number;
6588
6588
  };
6589
- type ColIncrementOptions = Omit<ColumnOptions, "serialize" | "prepare" | "primaryKey" | "nullable">;
6590
- type ColBigIncrementOptions = Omit<ColumnOptions, "serialize" | "prepare" | "primaryKey" | "nullable">;
6591
- type ColBooleanOptions = Omit<ColumnOptions, "prepare" | "serialize">;
6592
- type ColDateOptions = Omit<DateColumnOptions, "format" | "serialize" | "prepare">;
6593
- type ColDatetimeOptions = Omit<DatetimeColumnOptions, "serialize" | "prepare">;
6594
- type ColTimestampOptions = Omit<DatetimeColumnOptions, "serialize" | "prepare">;
6595
- type ColTimeOptions = Omit<DateColumnOptions, "format" | "serialize" | "prepare">;
6596
- type ColJsonOptions = Omit<ColumnOptions, "prepare" | "serialize">;
6597
- type ColUuidOptions = Omit<ColumnOptions, "prepare" | "serialize">;
6598
- type ColUlidOptions = Omit<ColumnOptions, "prepare" | "serialize">;
6599
- type ColBinaryOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare">;
6600
- type ColEnumOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare">;
6589
+ type ColIncrementOptions = Omit<ColumnOptions, "serialize" | "prepare" | "primaryKey" | "nullable" | "default">;
6590
+ type ColBigIncrementOptions = Omit<ColumnOptions, "serialize" | "prepare" | "primaryKey" | "nullable" | "default">;
6591
+ type ColBooleanOptions = Omit<ColumnOptions, "prepare" | "serialize" | "default">;
6592
+ type ColDateOptions = Omit<DateColumnOptions, "format" | "serialize" | "prepare" | "default">;
6593
+ type ColDatetimeOptions = Omit<DatetimeColumnOptions, "serialize" | "prepare" | "default">;
6594
+ type ColTimestampOptions = Omit<DatetimeColumnOptions, "serialize" | "prepare" | "default">;
6595
+ type ColTimeOptions = Omit<DateColumnOptions, "format" | "serialize" | "prepare" | "default">;
6596
+ type ColJsonOptions = Omit<ColumnOptions, "prepare" | "serialize" | "default">;
6597
+ type ColUuidOptions = Omit<ColumnOptions, "prepare" | "serialize" | "default">;
6598
+ type ColUlidOptions = Omit<ColumnOptions, "prepare" | "serialize" | "default">;
6599
+ type ColBinaryOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6600
+ type ColEnumOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6601
6601
  type ColSymmetricOptions = Omit<SymmetricEncryptionOptions, "prepare" | "serialize">;
6602
6602
  type ColAsymmetricOptions = Omit<AsymmetricEncryptionOptions, "prepare" | "serialize">;
6603
6603
  type RelationConstraintOptions = {
@@ -6631,6 +6631,14 @@ type TypedSerialize<T> = {
6631
6631
  type TypedPrepare<T> = {
6632
6632
  prepare?: (value: T) => any;
6633
6633
  };
6634
+ type TypedDefault<T> = {
6635
+ /**
6636
+ * Narrows the `default` property to the column's base type.
6637
+ * @migration Migration-only metadata. Sets the DEFAULT clause in CREATE TABLE / ALTER TABLE.
6638
+ * Does **not** enforce a value during `insert()` — pass the value explicitly or use `prepare`.
6639
+ */
6640
+ default?: T | null;
6641
+ };
6634
6642
  interface ColNamespace {
6635
6643
  /**
6636
6644
  * Generic column — you control the TypeScript type via `col<T>()`.
@@ -6643,7 +6651,7 @@ interface ColNamespace {
6643
6651
  * col<MyCustomType>({ serialize: (raw) => parse(raw), prepare: (v) => stringify(v) })
6644
6652
  * ```
6645
6653
  */
6646
- <T = unknown>(options?: ColOptions & TypedSerialize<T> & TypedPrepare<T>): ColumnDef<T>;
6654
+ <T = unknown>(options?: ColOptions & TypedSerialize<T> & TypedPrepare<T> & TypedDefault<T>): ColumnDef<T>;
6647
6655
  /**
6648
6656
  * Generic primary key column. Defaults to `string | number`.
6649
6657
  * Override the generic when you know the exact type.
@@ -6652,7 +6660,7 @@ interface ColNamespace {
6652
6660
  * col.primary<number>({ nullable: false })
6653
6661
  * ```
6654
6662
  */
6655
- primary<T = string | number>(options?: ColPrimaryOptions & TypedSerialize<T> & TypedPrepare<T>): PrimaryColumnDef<T>;
6663
+ primary<T = string | number>(options?: ColPrimaryOptions & TypedSerialize<T> & TypedPrepare<T> & TypedDefault<T>): PrimaryColumnDef<T>;
6656
6664
  /**
6657
6665
  * VARCHAR column. Accepts an optional `length` option.
6658
6666
  * Type: `string` (nullable-aware).
@@ -6662,27 +6670,27 @@ interface ColNamespace {
6662
6670
  * col.string() // string | null | undefined
6663
6671
  * ```
6664
6672
  */
6665
- string<O extends ColStringOptions = ColStringOptions>(options?: O & TypedSerialize<NullableColumn<string, O>> & TypedPrepare<NullableColumn<string, O>>): ColumnDef<NullableColumn<string, O>>;
6673
+ string<O extends ColStringOptions = ColStringOptions>(options?: O & TypedSerialize<NullableColumn<string, O>> & TypedPrepare<NullableColumn<string, O>> & TypedDefault<string>): ColumnDef<NullableColumn<string, O>>;
6666
6674
  /**
6667
6675
  * LONGTEXT column for large text content.
6668
6676
  * Type: `string` (nullable-aware).
6669
6677
  */
6670
- text<O extends ColTextOptions = ColTextOptions>(options?: O & TypedSerialize<NullableColumn<string, O>> & TypedPrepare<NullableColumn<string, O>>): ColumnDef<NullableColumn<string, O>>;
6678
+ text<O extends ColTextOptions = ColTextOptions>(options?: O & TypedSerialize<NullableColumn<string, O>> & TypedPrepare<NullableColumn<string, O>> & TypedDefault<string>): ColumnDef<NullableColumn<string, O>>;
6671
6679
  /**
6672
6680
  * Integer column.
6673
6681
  * Type: `number` (nullable-aware). Only `prepare` is exposed (no `serialize`).
6674
6682
  */
6675
- integer<O extends ColIntegerOptions = ColIntegerOptions>(options?: O & TypedPrepare<NullableColumn<number, O>>): ColumnDef<NullableColumn<number, O>>;
6683
+ integer<O extends ColIntegerOptions = ColIntegerOptions>(options?: O & TypedPrepare<NullableColumn<number, O>> & TypedDefault<number>): ColumnDef<NullableColumn<number, O>>;
6676
6684
  /**
6677
6685
  * Big integer column for values exceeding 32-bit range.
6678
6686
  * Type: `number` (nullable-aware). Only `prepare` is exposed.
6679
6687
  */
6680
- bigInteger<O extends ColBigIntegerOptions = ColBigIntegerOptions>(options?: O & TypedPrepare<NullableColumn<number, O>>): ColumnDef<NullableColumn<number, O>>;
6688
+ bigInteger<O extends ColBigIntegerOptions = ColBigIntegerOptions>(options?: O & TypedPrepare<NullableColumn<number, O>> & TypedDefault<number>): ColumnDef<NullableColumn<number, O>>;
6681
6689
  /**
6682
6690
  * Floating-point column.
6683
6691
  * Type: `number` (nullable-aware). Only `prepare` is exposed.
6684
6692
  */
6685
- float<O extends ColFloatOptions = ColFloatOptions>(options?: O & TypedPrepare<NullableColumn<number, O>>): ColumnDef<NullableColumn<number, O>>;
6693
+ float<O extends ColFloatOptions = ColFloatOptions>(options?: O & TypedPrepare<NullableColumn<number, O>> & TypedDefault<number>): ColumnDef<NullableColumn<number, O>>;
6686
6694
  /**
6687
6695
  * Decimal column with optional `precision` and `scale`.
6688
6696
  * Type: `number` (nullable-aware). Only `prepare` is exposed.
@@ -6691,22 +6699,22 @@ interface ColNamespace {
6691
6699
  * col.decimal({ precision: 10, scale: 2, nullable: false }) // number
6692
6700
  * ```
6693
6701
  */
6694
- decimal<O extends ColDecimalOptions = ColDecimalOptions>(options?: O & TypedPrepare<NullableColumn<number, O>>): ColumnDef<NullableColumn<number, O>>;
6702
+ decimal<O extends ColDecimalOptions = ColDecimalOptions>(options?: O & TypedPrepare<NullableColumn<number, O>> & TypedDefault<number>): ColumnDef<NullableColumn<number, O>>;
6695
6703
  /**
6696
6704
  * Auto-incrementing integer primary key. Always non-nullable.
6697
6705
  * Type: `number`. Only `prepare` is exposed.
6698
6706
  */
6699
- increment(options?: ColIncrementOptions & TypedPrepare<number>): PrimaryColumnDef<number>;
6707
+ increment(options?: ColIncrementOptions & TypedPrepare<number> & TypedDefault<number>): PrimaryColumnDef<number>;
6700
6708
  /**
6701
6709
  * Auto-incrementing bigint primary key. Always non-nullable.
6702
6710
  * Type: `number`. Only `prepare` is exposed.
6703
6711
  */
6704
- bigIncrement(options?: ColBigIncrementOptions & TypedPrepare<number>): PrimaryColumnDef<number>;
6712
+ bigIncrement(options?: ColBigIncrementOptions & TypedPrepare<number> & TypedDefault<number>): PrimaryColumnDef<number>;
6705
6713
  /**
6706
6714
  * Boolean column.
6707
6715
  * Type: `boolean` (nullable-aware). No `serialize` or `prepare` exposed.
6708
6716
  */
6709
- boolean<O extends ColBooleanOptions = ColBooleanOptions>(options?: O): ColumnDef<NullableColumn<boolean, O>>;
6717
+ boolean<O extends ColBooleanOptions = ColBooleanOptions>(options?: O & TypedDefault<boolean>): ColumnDef<NullableColumn<boolean, O>>;
6710
6718
  /**
6711
6719
  * DATE column (YYYY-MM-DD). Defaults to `Date` because database drivers
6712
6720
  * return `Date` objects.
@@ -6720,8 +6728,8 @@ interface ColNamespace {
6720
6728
  */
6721
6729
  date<T extends Date | string = Date>(options: ColDateOptions & {
6722
6730
  nullable: false;
6723
- } & TypedSerialize<T> & TypedPrepare<T>): ColumnDef<T>;
6724
- date<T extends Date | string = Date>(options?: ColDateOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined>): ColumnDef<T | null | undefined>;
6731
+ } & TypedSerialize<T> & TypedPrepare<T> & TypedDefault<string>): ColumnDef<T>;
6732
+ date<T extends Date | string = Date>(options?: ColDateOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined> & TypedDefault<string>): ColumnDef<T | null | undefined>;
6725
6733
  /**
6726
6734
  * DATETIME column. Defaults to `Date` because database drivers return
6727
6735
  * `Date` objects.
@@ -6735,8 +6743,8 @@ interface ColNamespace {
6735
6743
  */
6736
6744
  datetime<T extends Date | string = Date>(options: ColDatetimeOptions & {
6737
6745
  nullable: false;
6738
- } & TypedSerialize<T> & TypedPrepare<T>): ColumnDef<T>;
6739
- datetime<T extends Date | string = Date>(options?: ColDatetimeOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined>): ColumnDef<T | null | undefined>;
6746
+ } & TypedSerialize<T> & TypedPrepare<T> & TypedDefault<string>): ColumnDef<T>;
6747
+ datetime<T extends Date | string = Date>(options?: ColDatetimeOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined> & TypedDefault<string>): ColumnDef<T | null | undefined>;
6740
6748
  /**
6741
6749
  * TIMESTAMP column. Defaults to `Date` because database drivers return
6742
6750
  * `Date` objects.
@@ -6750,8 +6758,8 @@ interface ColNamespace {
6750
6758
  */
6751
6759
  timestamp<T extends Date | string = Date>(options: ColTimestampOptions & {
6752
6760
  nullable: false;
6753
- } & TypedSerialize<T> & TypedPrepare<T>): ColumnDef<T>;
6754
- timestamp<T extends Date | string = Date>(options?: ColTimestampOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined>): ColumnDef<T | null | undefined>;
6761
+ } & TypedSerialize<T> & TypedPrepare<T> & TypedDefault<string>): ColumnDef<T>;
6762
+ timestamp<T extends Date | string = Date>(options?: ColTimestampOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined> & TypedDefault<string>): ColumnDef<T | null | undefined>;
6755
6763
  /**
6756
6764
  * TIME column. Defaults to `Date` because database drivers return
6757
6765
  * `Date` objects.
@@ -6765,8 +6773,8 @@ interface ColNamespace {
6765
6773
  */
6766
6774
  time<T extends Date | string = Date>(options: ColTimeOptions & {
6767
6775
  nullable: false;
6768
- } & TypedSerialize<T> & TypedPrepare<T>): ColumnDef<T>;
6769
- time<T extends Date | string = Date>(options?: ColTimeOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined>): ColumnDef<T | null | undefined>;
6776
+ } & TypedSerialize<T> & TypedPrepare<T> & TypedDefault<string>): ColumnDef<T>;
6777
+ time<T extends Date | string = Date>(options?: ColTimeOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined> & TypedDefault<string>): ColumnDef<T | null | undefined>;
6770
6778
  /**
6771
6779
  * JSON/JSONB column. Defaults to `unknown`.
6772
6780
  * Pass a concrete type for structured JSON data: `col.json<MyType>()`.
@@ -6780,24 +6788,24 @@ interface ColNamespace {
6780
6788
  */
6781
6789
  json<T = unknown>(options: ColJsonOptions & {
6782
6790
  nullable: false;
6783
- }): ColumnDef<T>;
6784
- json<T = unknown>(options?: ColJsonOptions): ColumnDef<T | null | undefined>;
6791
+ } & TypedDefault<string>): ColumnDef<T>;
6792
+ json<T = unknown>(options?: ColJsonOptions & TypedDefault<string>): ColumnDef<T | null | undefined>;
6785
6793
  /**
6786
6794
  * UUID column. Auto-generates a UUID if no value is provided on insert.
6787
6795
  * Type: `string` (nullable-aware). Only `serialize` is exposed.
6788
6796
  */
6789
- uuid<O extends ColUuidOptions = ColUuidOptions>(options?: O & TypedSerialize<NullableColumn<string, O>>): ColumnDef<NullableColumn<string, O>>;
6797
+ uuid<O extends ColUuidOptions = ColUuidOptions>(options?: O & TypedSerialize<NullableColumn<string, O>> & TypedDefault<string>): ColumnDef<NullableColumn<string, O>>;
6790
6798
  /**
6791
6799
  * ULID column. Auto-generates a ULID if no value is provided on insert.
6792
6800
  * Type: `string` (nullable-aware). Only `serialize` is exposed.
6793
6801
  */
6794
- ulid<O extends ColUlidOptions = ColUlidOptions>(options?: O & TypedSerialize<NullableColumn<string, O>>): ColumnDef<NullableColumn<string, O>>;
6802
+ ulid<O extends ColUlidOptions = ColUlidOptions>(options?: O & TypedSerialize<NullableColumn<string, O>> & TypedDefault<string>): ColumnDef<NullableColumn<string, O>>;
6795
6803
  /**
6796
6804
  * Binary/blob column.
6797
6805
  * Type: `Buffer | Uint8Array | string` (nullable-aware).
6798
6806
  * Supports typed `serialize` and `prepare`.
6799
6807
  */
6800
- binary<T extends Buffer | Uint8Array | string = Buffer | Uint8Array | string, O extends ColBinaryOptions = ColBinaryOptions>(options?: O & TypedSerialize<NullableColumn<T, O>> & TypedPrepare<NullableColumn<T, O>>): ColumnDef<NullableColumn<T, O>>;
6808
+ binary<T extends Buffer | Uint8Array | string = Buffer | Uint8Array | string, O extends ColBinaryOptions = ColBinaryOptions>(options?: O & TypedSerialize<NullableColumn<T, O>> & TypedPrepare<NullableColumn<T, O>> & TypedDefault<string>): ColumnDef<NullableColumn<T, O>>;
6801
6809
  /**
6802
6810
  * Enum column constrained to the given values array.
6803
6811
  * Type: `values[number]` (nullable-aware).
@@ -6807,7 +6815,7 @@ interface ColNamespace {
6807
6815
  * col.enum(["active", "inactive"] as const, { nullable: false }) // "active" | "inactive"
6808
6816
  * ```
6809
6817
  */
6810
- enum<const V extends readonly string[], O extends ColEnumOptions = ColEnumOptions>(values: V, options?: O & TypedSerialize<NullableColumn<V[number], O>> & TypedPrepare<NullableColumn<V[number], O>>): ColumnDef<NullableColumn<V[number], O>>;
6818
+ enum<const V extends readonly string[], O extends ColEnumOptions = ColEnumOptions>(values: V, options?: O & TypedSerialize<NullableColumn<V[number], O>> & TypedPrepare<NullableColumn<V[number], O>> & TypedDefault<V[number]>): ColumnDef<NullableColumn<V[number], O>>;
6811
6819
  /** Encryption column helpers. */
6812
6820
  encryption: {
6813
6821
  /**
@@ -8561,4 +8569,4 @@ declare const generateOpenApiModelWithMetadata: <T extends new () => Model>(mode
8561
8569
  $id?: string;
8562
8570
  }>;
8563
8571
 
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 };
8572
+ 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 TypedDefault, 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
@@ -3282,8 +3282,8 @@ type ColumnOptions = {
3282
3282
  */
3283
3283
  nullable?: boolean;
3284
3284
  /**
3285
- * @description The default value for the column in the database
3286
- * @migration Only affects auto-generated migrations
3285
+ * @description The default value for the column in the database.
3286
+ * @migration Only affects auto-generated migrations (CREATE TABLE / ALTER TABLE). Does NOT set a default value during insert operations — use `prepare` for that.
3287
3287
  */
3288
3288
  default?: string | number | null | boolean;
3289
3289
  } &
@@ -6573,31 +6573,31 @@ interface RelationDef<T = any> {
6573
6573
  readonly _phantom: T;
6574
6574
  readonly _apply: (target: Object, propertyKey: string) => void;
6575
6575
  }
6576
- type ColOptions = Omit<ColumnOptions, "primaryKey" | "serialize" | "prepare">;
6577
- type ColPrimaryOptions = Omit<ColumnOptions, "primaryKey" | "serialize" | "prepare">;
6578
- type ColStringOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare"> & {
6576
+ type ColOptions = Omit<ColumnOptions, "primaryKey" | "serialize" | "prepare" | "default">;
6577
+ type ColPrimaryOptions = Omit<ColumnOptions, "primaryKey" | "serialize" | "prepare" | "default">;
6578
+ type ColStringOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default"> & {
6579
6579
  length?: number;
6580
6580
  };
6581
- type ColTextOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare">;
6582
- type ColIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare">;
6583
- type ColBigIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare">;
6584
- type ColFloatOptions = Omit<ColumnOptions, "serialize" | "prepare">;
6585
- type ColDecimalOptions = Omit<ColumnOptions, "serialize" | "prepare"> & {
6581
+ type ColTextOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6582
+ type ColIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default">;
6583
+ type ColBigIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default">;
6584
+ type ColFloatOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default">;
6585
+ type ColDecimalOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default"> & {
6586
6586
  precision?: number;
6587
6587
  scale?: number;
6588
6588
  };
6589
- type ColIncrementOptions = Omit<ColumnOptions, "serialize" | "prepare" | "primaryKey" | "nullable">;
6590
- type ColBigIncrementOptions = Omit<ColumnOptions, "serialize" | "prepare" | "primaryKey" | "nullable">;
6591
- type ColBooleanOptions = Omit<ColumnOptions, "prepare" | "serialize">;
6592
- type ColDateOptions = Omit<DateColumnOptions, "format" | "serialize" | "prepare">;
6593
- type ColDatetimeOptions = Omit<DatetimeColumnOptions, "serialize" | "prepare">;
6594
- type ColTimestampOptions = Omit<DatetimeColumnOptions, "serialize" | "prepare">;
6595
- type ColTimeOptions = Omit<DateColumnOptions, "format" | "serialize" | "prepare">;
6596
- type ColJsonOptions = Omit<ColumnOptions, "prepare" | "serialize">;
6597
- type ColUuidOptions = Omit<ColumnOptions, "prepare" | "serialize">;
6598
- type ColUlidOptions = Omit<ColumnOptions, "prepare" | "serialize">;
6599
- type ColBinaryOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare">;
6600
- type ColEnumOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare">;
6589
+ type ColIncrementOptions = Omit<ColumnOptions, "serialize" | "prepare" | "primaryKey" | "nullable" | "default">;
6590
+ type ColBigIncrementOptions = Omit<ColumnOptions, "serialize" | "prepare" | "primaryKey" | "nullable" | "default">;
6591
+ type ColBooleanOptions = Omit<ColumnOptions, "prepare" | "serialize" | "default">;
6592
+ type ColDateOptions = Omit<DateColumnOptions, "format" | "serialize" | "prepare" | "default">;
6593
+ type ColDatetimeOptions = Omit<DatetimeColumnOptions, "serialize" | "prepare" | "default">;
6594
+ type ColTimestampOptions = Omit<DatetimeColumnOptions, "serialize" | "prepare" | "default">;
6595
+ type ColTimeOptions = Omit<DateColumnOptions, "format" | "serialize" | "prepare" | "default">;
6596
+ type ColJsonOptions = Omit<ColumnOptions, "prepare" | "serialize" | "default">;
6597
+ type ColUuidOptions = Omit<ColumnOptions, "prepare" | "serialize" | "default">;
6598
+ type ColUlidOptions = Omit<ColumnOptions, "prepare" | "serialize" | "default">;
6599
+ type ColBinaryOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6600
+ type ColEnumOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6601
6601
  type ColSymmetricOptions = Omit<SymmetricEncryptionOptions, "prepare" | "serialize">;
6602
6602
  type ColAsymmetricOptions = Omit<AsymmetricEncryptionOptions, "prepare" | "serialize">;
6603
6603
  type RelationConstraintOptions = {
@@ -6631,6 +6631,14 @@ type TypedSerialize<T> = {
6631
6631
  type TypedPrepare<T> = {
6632
6632
  prepare?: (value: T) => any;
6633
6633
  };
6634
+ type TypedDefault<T> = {
6635
+ /**
6636
+ * Narrows the `default` property to the column's base type.
6637
+ * @migration Migration-only metadata. Sets the DEFAULT clause in CREATE TABLE / ALTER TABLE.
6638
+ * Does **not** enforce a value during `insert()` — pass the value explicitly or use `prepare`.
6639
+ */
6640
+ default?: T | null;
6641
+ };
6634
6642
  interface ColNamespace {
6635
6643
  /**
6636
6644
  * Generic column — you control the TypeScript type via `col<T>()`.
@@ -6643,7 +6651,7 @@ interface ColNamespace {
6643
6651
  * col<MyCustomType>({ serialize: (raw) => parse(raw), prepare: (v) => stringify(v) })
6644
6652
  * ```
6645
6653
  */
6646
- <T = unknown>(options?: ColOptions & TypedSerialize<T> & TypedPrepare<T>): ColumnDef<T>;
6654
+ <T = unknown>(options?: ColOptions & TypedSerialize<T> & TypedPrepare<T> & TypedDefault<T>): ColumnDef<T>;
6647
6655
  /**
6648
6656
  * Generic primary key column. Defaults to `string | number`.
6649
6657
  * Override the generic when you know the exact type.
@@ -6652,7 +6660,7 @@ interface ColNamespace {
6652
6660
  * col.primary<number>({ nullable: false })
6653
6661
  * ```
6654
6662
  */
6655
- primary<T = string | number>(options?: ColPrimaryOptions & TypedSerialize<T> & TypedPrepare<T>): PrimaryColumnDef<T>;
6663
+ primary<T = string | number>(options?: ColPrimaryOptions & TypedSerialize<T> & TypedPrepare<T> & TypedDefault<T>): PrimaryColumnDef<T>;
6656
6664
  /**
6657
6665
  * VARCHAR column. Accepts an optional `length` option.
6658
6666
  * Type: `string` (nullable-aware).
@@ -6662,27 +6670,27 @@ interface ColNamespace {
6662
6670
  * col.string() // string | null | undefined
6663
6671
  * ```
6664
6672
  */
6665
- string<O extends ColStringOptions = ColStringOptions>(options?: O & TypedSerialize<NullableColumn<string, O>> & TypedPrepare<NullableColumn<string, O>>): ColumnDef<NullableColumn<string, O>>;
6673
+ string<O extends ColStringOptions = ColStringOptions>(options?: O & TypedSerialize<NullableColumn<string, O>> & TypedPrepare<NullableColumn<string, O>> & TypedDefault<string>): ColumnDef<NullableColumn<string, O>>;
6666
6674
  /**
6667
6675
  * LONGTEXT column for large text content.
6668
6676
  * Type: `string` (nullable-aware).
6669
6677
  */
6670
- text<O extends ColTextOptions = ColTextOptions>(options?: O & TypedSerialize<NullableColumn<string, O>> & TypedPrepare<NullableColumn<string, O>>): ColumnDef<NullableColumn<string, O>>;
6678
+ text<O extends ColTextOptions = ColTextOptions>(options?: O & TypedSerialize<NullableColumn<string, O>> & TypedPrepare<NullableColumn<string, O>> & TypedDefault<string>): ColumnDef<NullableColumn<string, O>>;
6671
6679
  /**
6672
6680
  * Integer column.
6673
6681
  * Type: `number` (nullable-aware). Only `prepare` is exposed (no `serialize`).
6674
6682
  */
6675
- integer<O extends ColIntegerOptions = ColIntegerOptions>(options?: O & TypedPrepare<NullableColumn<number, O>>): ColumnDef<NullableColumn<number, O>>;
6683
+ integer<O extends ColIntegerOptions = ColIntegerOptions>(options?: O & TypedPrepare<NullableColumn<number, O>> & TypedDefault<number>): ColumnDef<NullableColumn<number, O>>;
6676
6684
  /**
6677
6685
  * Big integer column for values exceeding 32-bit range.
6678
6686
  * Type: `number` (nullable-aware). Only `prepare` is exposed.
6679
6687
  */
6680
- bigInteger<O extends ColBigIntegerOptions = ColBigIntegerOptions>(options?: O & TypedPrepare<NullableColumn<number, O>>): ColumnDef<NullableColumn<number, O>>;
6688
+ bigInteger<O extends ColBigIntegerOptions = ColBigIntegerOptions>(options?: O & TypedPrepare<NullableColumn<number, O>> & TypedDefault<number>): ColumnDef<NullableColumn<number, O>>;
6681
6689
  /**
6682
6690
  * Floating-point column.
6683
6691
  * Type: `number` (nullable-aware). Only `prepare` is exposed.
6684
6692
  */
6685
- float<O extends ColFloatOptions = ColFloatOptions>(options?: O & TypedPrepare<NullableColumn<number, O>>): ColumnDef<NullableColumn<number, O>>;
6693
+ float<O extends ColFloatOptions = ColFloatOptions>(options?: O & TypedPrepare<NullableColumn<number, O>> & TypedDefault<number>): ColumnDef<NullableColumn<number, O>>;
6686
6694
  /**
6687
6695
  * Decimal column with optional `precision` and `scale`.
6688
6696
  * Type: `number` (nullable-aware). Only `prepare` is exposed.
@@ -6691,22 +6699,22 @@ interface ColNamespace {
6691
6699
  * col.decimal({ precision: 10, scale: 2, nullable: false }) // number
6692
6700
  * ```
6693
6701
  */
6694
- decimal<O extends ColDecimalOptions = ColDecimalOptions>(options?: O & TypedPrepare<NullableColumn<number, O>>): ColumnDef<NullableColumn<number, O>>;
6702
+ decimal<O extends ColDecimalOptions = ColDecimalOptions>(options?: O & TypedPrepare<NullableColumn<number, O>> & TypedDefault<number>): ColumnDef<NullableColumn<number, O>>;
6695
6703
  /**
6696
6704
  * Auto-incrementing integer primary key. Always non-nullable.
6697
6705
  * Type: `number`. Only `prepare` is exposed.
6698
6706
  */
6699
- increment(options?: ColIncrementOptions & TypedPrepare<number>): PrimaryColumnDef<number>;
6707
+ increment(options?: ColIncrementOptions & TypedPrepare<number> & TypedDefault<number>): PrimaryColumnDef<number>;
6700
6708
  /**
6701
6709
  * Auto-incrementing bigint primary key. Always non-nullable.
6702
6710
  * Type: `number`. Only `prepare` is exposed.
6703
6711
  */
6704
- bigIncrement(options?: ColBigIncrementOptions & TypedPrepare<number>): PrimaryColumnDef<number>;
6712
+ bigIncrement(options?: ColBigIncrementOptions & TypedPrepare<number> & TypedDefault<number>): PrimaryColumnDef<number>;
6705
6713
  /**
6706
6714
  * Boolean column.
6707
6715
  * Type: `boolean` (nullable-aware). No `serialize` or `prepare` exposed.
6708
6716
  */
6709
- boolean<O extends ColBooleanOptions = ColBooleanOptions>(options?: O): ColumnDef<NullableColumn<boolean, O>>;
6717
+ boolean<O extends ColBooleanOptions = ColBooleanOptions>(options?: O & TypedDefault<boolean>): ColumnDef<NullableColumn<boolean, O>>;
6710
6718
  /**
6711
6719
  * DATE column (YYYY-MM-DD). Defaults to `Date` because database drivers
6712
6720
  * return `Date` objects.
@@ -6720,8 +6728,8 @@ interface ColNamespace {
6720
6728
  */
6721
6729
  date<T extends Date | string = Date>(options: ColDateOptions & {
6722
6730
  nullable: false;
6723
- } & TypedSerialize<T> & TypedPrepare<T>): ColumnDef<T>;
6724
- date<T extends Date | string = Date>(options?: ColDateOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined>): ColumnDef<T | null | undefined>;
6731
+ } & TypedSerialize<T> & TypedPrepare<T> & TypedDefault<string>): ColumnDef<T>;
6732
+ date<T extends Date | string = Date>(options?: ColDateOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined> & TypedDefault<string>): ColumnDef<T | null | undefined>;
6725
6733
  /**
6726
6734
  * DATETIME column. Defaults to `Date` because database drivers return
6727
6735
  * `Date` objects.
@@ -6735,8 +6743,8 @@ interface ColNamespace {
6735
6743
  */
6736
6744
  datetime<T extends Date | string = Date>(options: ColDatetimeOptions & {
6737
6745
  nullable: false;
6738
- } & TypedSerialize<T> & TypedPrepare<T>): ColumnDef<T>;
6739
- datetime<T extends Date | string = Date>(options?: ColDatetimeOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined>): ColumnDef<T | null | undefined>;
6746
+ } & TypedSerialize<T> & TypedPrepare<T> & TypedDefault<string>): ColumnDef<T>;
6747
+ datetime<T extends Date | string = Date>(options?: ColDatetimeOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined> & TypedDefault<string>): ColumnDef<T | null | undefined>;
6740
6748
  /**
6741
6749
  * TIMESTAMP column. Defaults to `Date` because database drivers return
6742
6750
  * `Date` objects.
@@ -6750,8 +6758,8 @@ interface ColNamespace {
6750
6758
  */
6751
6759
  timestamp<T extends Date | string = Date>(options: ColTimestampOptions & {
6752
6760
  nullable: false;
6753
- } & TypedSerialize<T> & TypedPrepare<T>): ColumnDef<T>;
6754
- timestamp<T extends Date | string = Date>(options?: ColTimestampOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined>): ColumnDef<T | null | undefined>;
6761
+ } & TypedSerialize<T> & TypedPrepare<T> & TypedDefault<string>): ColumnDef<T>;
6762
+ timestamp<T extends Date | string = Date>(options?: ColTimestampOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined> & TypedDefault<string>): ColumnDef<T | null | undefined>;
6755
6763
  /**
6756
6764
  * TIME column. Defaults to `Date` because database drivers return
6757
6765
  * `Date` objects.
@@ -6765,8 +6773,8 @@ interface ColNamespace {
6765
6773
  */
6766
6774
  time<T extends Date | string = Date>(options: ColTimeOptions & {
6767
6775
  nullable: false;
6768
- } & TypedSerialize<T> & TypedPrepare<T>): ColumnDef<T>;
6769
- time<T extends Date | string = Date>(options?: ColTimeOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined>): ColumnDef<T | null | undefined>;
6776
+ } & TypedSerialize<T> & TypedPrepare<T> & TypedDefault<string>): ColumnDef<T>;
6777
+ time<T extends Date | string = Date>(options?: ColTimeOptions & TypedSerialize<T | null | undefined> & TypedPrepare<T | null | undefined> & TypedDefault<string>): ColumnDef<T | null | undefined>;
6770
6778
  /**
6771
6779
  * JSON/JSONB column. Defaults to `unknown`.
6772
6780
  * Pass a concrete type for structured JSON data: `col.json<MyType>()`.
@@ -6780,24 +6788,24 @@ interface ColNamespace {
6780
6788
  */
6781
6789
  json<T = unknown>(options: ColJsonOptions & {
6782
6790
  nullable: false;
6783
- }): ColumnDef<T>;
6784
- json<T = unknown>(options?: ColJsonOptions): ColumnDef<T | null | undefined>;
6791
+ } & TypedDefault<string>): ColumnDef<T>;
6792
+ json<T = unknown>(options?: ColJsonOptions & TypedDefault<string>): ColumnDef<T | null | undefined>;
6785
6793
  /**
6786
6794
  * UUID column. Auto-generates a UUID if no value is provided on insert.
6787
6795
  * Type: `string` (nullable-aware). Only `serialize` is exposed.
6788
6796
  */
6789
- uuid<O extends ColUuidOptions = ColUuidOptions>(options?: O & TypedSerialize<NullableColumn<string, O>>): ColumnDef<NullableColumn<string, O>>;
6797
+ uuid<O extends ColUuidOptions = ColUuidOptions>(options?: O & TypedSerialize<NullableColumn<string, O>> & TypedDefault<string>): ColumnDef<NullableColumn<string, O>>;
6790
6798
  /**
6791
6799
  * ULID column. Auto-generates a ULID if no value is provided on insert.
6792
6800
  * Type: `string` (nullable-aware). Only `serialize` is exposed.
6793
6801
  */
6794
- ulid<O extends ColUlidOptions = ColUlidOptions>(options?: O & TypedSerialize<NullableColumn<string, O>>): ColumnDef<NullableColumn<string, O>>;
6802
+ ulid<O extends ColUlidOptions = ColUlidOptions>(options?: O & TypedSerialize<NullableColumn<string, O>> & TypedDefault<string>): ColumnDef<NullableColumn<string, O>>;
6795
6803
  /**
6796
6804
  * Binary/blob column.
6797
6805
  * Type: `Buffer | Uint8Array | string` (nullable-aware).
6798
6806
  * Supports typed `serialize` and `prepare`.
6799
6807
  */
6800
- binary<T extends Buffer | Uint8Array | string = Buffer | Uint8Array | string, O extends ColBinaryOptions = ColBinaryOptions>(options?: O & TypedSerialize<NullableColumn<T, O>> & TypedPrepare<NullableColumn<T, O>>): ColumnDef<NullableColumn<T, O>>;
6808
+ binary<T extends Buffer | Uint8Array | string = Buffer | Uint8Array | string, O extends ColBinaryOptions = ColBinaryOptions>(options?: O & TypedSerialize<NullableColumn<T, O>> & TypedPrepare<NullableColumn<T, O>> & TypedDefault<string>): ColumnDef<NullableColumn<T, O>>;
6801
6809
  /**
6802
6810
  * Enum column constrained to the given values array.
6803
6811
  * Type: `values[number]` (nullable-aware).
@@ -6807,7 +6815,7 @@ interface ColNamespace {
6807
6815
  * col.enum(["active", "inactive"] as const, { nullable: false }) // "active" | "inactive"
6808
6816
  * ```
6809
6817
  */
6810
- enum<const V extends readonly string[], O extends ColEnumOptions = ColEnumOptions>(values: V, options?: O & TypedSerialize<NullableColumn<V[number], O>> & TypedPrepare<NullableColumn<V[number], O>>): ColumnDef<NullableColumn<V[number], O>>;
6818
+ enum<const V extends readonly string[], O extends ColEnumOptions = ColEnumOptions>(values: V, options?: O & TypedSerialize<NullableColumn<V[number], O>> & TypedPrepare<NullableColumn<V[number], O>> & TypedDefault<V[number]>): ColumnDef<NullableColumn<V[number], O>>;
6811
6819
  /** Encryption column helpers. */
6812
6820
  encryption: {
6813
6821
  /**
@@ -8561,4 +8569,4 @@ declare const generateOpenApiModelWithMetadata: <T extends new () => Model>(mode
8561
8569
  $id?: string;
8562
8570
  }>;
8563
8571
 
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 };
8572
+ 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 TypedDefault, 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 };