/** * Column Builder * * Fluent API for defining columns in migrations. */ import type { CanonicalType, ForeignKeyAction } from '../../schema/types.js'; import type { BaseColumnOptions, FullColumnDefinition, IColumnBuilder, IForeignKeyBuilder } from './types.js'; /** * Builder for column definitions with a fluent API. * Columns are NOT NULL by default (safer). */ export declare class ColumnBuilder implements IColumnBuilder, IForeignKeyBuilder { private _name; private _type; private _nullable; private _defaultValue?; private _primaryKey; private _autoIncrement; private _unique; private _comment?; private _index?; private _foreignKey?; constructor(name: string, type: CanonicalType, options?: BaseColumnOptions); /** * Make the column nullable or not nullable. */ nullable(value?: boolean): this; /** * Make the column NOT NULL. */ notNullable(): this; /** * Set a default value for the column. */ defaultValue(value: unknown): this; /** * Mark as primary key. */ primaryKey(): this; /** * Enable auto-increment (for integer types). */ autoIncrement(): this; /** * Add a unique constraint. */ unique(): this; /** * Add a comment to the column. */ comment(text: string): this; /** * Add an index on this column. * @param name - Optional index name. If true, auto-generates name. */ index(name?: string): this; /** * Set as unsigned (MySQL/MariaDB). */ unsigned(): this; /** * Add a foreign key reference. * Returns a ForeignKeyBuilder for additional options. */ references(table: string, column?: string): IForeignKeyBuilder; /** * Set ON DELETE action for foreign key. */ onDelete(action: ForeignKeyAction): this; /** * Set ON UPDATE action for foreign key. */ onUpdate(action: ForeignKeyAction): this; /** * Build and return the column definition. */ build(): FullColumnDefinition; } //# sourceMappingURL=columnBuilder.d.ts.map