/** * ColumnDefinition for `@atlex/orm` migrations. * * Provides a fluent chainable API (nullable, defaultTo, unique, index, unsigned, primary) * similar to common migration column modifiers. */ export interface ColumnModifier { kind: 'nullable' | 'default' | 'useCurrent' | 'unique' | 'index' | 'primary' | 'unsigned'; value?: unknown; name?: string; } /** Marker returned by `Blueprint.raw()` for SQL default expressions. */ export interface RawSqlExpression { readonly __atlexRawSql: string; } export declare function isRawSqlExpression(value: unknown): value is RawSqlExpression; export declare class ColumnDefinition { readonly name: string; readonly type: string; readonly args: readonly unknown[]; readonly modifiers: ColumnModifier[]; constructor(name: string, type: string, args?: readonly unknown[]); /** * Mark the column nullable. * * @returns this * @example * table.string('email').nullable() */ nullable(): this; /** * Knex-compatible alias; columns are NOT NULL unless `.nullable()` is called. */ notNullable(): this; /** * Set a default value. * * @param value - Default value. * @returns this * @example * table.boolean('active').defaultTo(true) */ defaultTo(value: unknown): this; /** * Set the default to the database "now" (e.g. PostgreSQL `CURRENT_TIMESTAMP`). * Prefer this over `defaultTo(new Date())`, which can stringify with a locale * timezone label and break drivers such as PostgreSQL. * * @returns this */ useCurrent(): this; /** * Create a unique index. * * @param name - Optional index name. * @returns this * @example * table.string('email').unique() */ unique(name?: string): this; /** * Create a non-unique index. * * @param name - Optional index name. * @returns this * @example * table.integer('user_id').index() */ index(name?: string): this; /** * Mark as primary key. * * @returns this * @example * table.bigIncrements('id').primary() */ primary(): this; /** * Mark the column unsigned (where supported). * * @returns this * @example * table.integer('age').unsigned() */ unsigned(): this; } //# sourceMappingURL=ColumnDefinition.d.ts.map