import { type ColumnSchema, type ForeignKeySchema, type IndexSchema, type TableSchema } from './migration/create';
import type { BaseDatabase } from './database';
import { type Dialect } from './sql';
export type SchemaTableCallback = (table: SchemaTableBuilder) => void;
export type SchemaAlterCallback = (table: SchemaAlterBuilder) => void;
export declare class DatabaseSchemaBuilder {
    private readonly db;
    private readonly enumTypeRegistry;
    constructor(db: BaseDatabase);
    create(tableName: string, callback: SchemaTableCallback): Promise<void>;
    alter(tableName: string, callback: SchemaAlterCallback): Promise<void>;
    drop(tableName: string): Promise<void>;
    dropIfExists(tableName: string): Promise<void>;
    rename(from: string, to: string): Promise<void>;
    enumType(name: string, values: readonly string[]): Promise<void>;
    raw(statement: string): Promise<void>;
    onlyOn(dialect: Dialect, callback: () => Promise<void>): Promise<void>;
    hasTable(tableName: string): Promise<boolean>;
    hasColumn(tableName: string, columnName: string): Promise<boolean>;
    hasIndex(tableName: string, indexName: string): Promise<boolean>;
    flush(): Promise<void>;
}
declare abstract class SchemaBlueprintBase {
    protected readonly tableName: string;
    protected readonly dialect: Dialect;
    constructor(tableName: string, dialect: Dialect);
    protected abstract addColumn(column: SchemaColumnBuilder): SchemaColumnBuilder;
    protected abstract addIndexSchema(index: IndexSchema): void;
    protected abstract addForeignKeySchema(foreignKey: ForeignKeySchema): void;
    id(name?: string): SchemaColumnBuilder;
    uuidString(name: string): SchemaColumnBuilder;
    uuid(name: string): SchemaColumnBuilder;
    string(name: string, size?: number): SchemaColumnBuilder;
    char(name: string, size?: number): SchemaColumnBuilder;
    text(name: string): SchemaColumnBuilder;
    tinyText(name: string): SchemaColumnBuilder;
    mediumText(name: string): SchemaColumnBuilder;
    longText(name: string): SchemaColumnBuilder;
    integer(name: string): SchemaColumnBuilder;
    tinyint(name: string): SchemaColumnBuilder;
    smallint(name: string): SchemaColumnBuilder;
    bigint(name: string): SchemaColumnBuilder;
    bigInteger(name: string): SchemaColumnBuilder;
    float(name: string): SchemaColumnBuilder;
    double(name: string): SchemaColumnBuilder;
    decimal(name: string, size?: number, scale?: number): SchemaColumnBuilder;
    boolean(name: string): SchemaColumnBuilder;
    dateTime(name: string): SchemaColumnBuilder;
    timestamp(name: string): SchemaColumnBuilder;
    timestamptz(name: string): SchemaColumnBuilder;
    time(name: string): SchemaColumnBuilder;
    date(name: string): SchemaColumnBuilder;
    json(name: string): SchemaColumnBuilder;
    jsonb(name: string): SchemaColumnBuilder;
    binary(name: string, size?: number): SchemaColumnBuilder;
    blob(name: string): SchemaColumnBuilder;
    enum(name: string, values: readonly string[], typeName?: string): SchemaColumnBuilder;
    point(name: string): SchemaColumnBuilder;
    timestamps(): void;
    index(columns: string | readonly string[], name?: string): this;
    unique(columns: string | readonly string[], name?: string): this;
    spatialIndex(columns: string | readonly string[], name?: string): this;
    foreign(columns: string | readonly string[], name?: string): SchemaForeignKeyBuilder;
    abstract primary(columns: string[]): this;
    protected column(name: string, type: string, size?: number, scale?: number): SchemaColumnBuilder;
}
export declare class SchemaTableBuilder extends SchemaBlueprintBase {
    private readonly columns;
    private readonly indexes;
    private readonly foreignKeys;
    private explicitPrimaryKeyColumns;
    protected addColumn(column: SchemaColumnBuilder): SchemaColumnBuilder;
    protected addIndexSchema(index: IndexSchema): void;
    protected addForeignKeySchema(foreignKey: ForeignKeySchema): void;
    primary(columns: string[]): this;
    toSchema(): TableSchema;
}
export declare class SchemaAlterBuilder extends SchemaBlueprintBase {
    private readonly operations;
    get enumColumns(): ColumnSchema[];
    protected addColumn(column: SchemaColumnBuilder): SchemaColumnBuilder;
    protected addIndexSchema(index: IndexSchema): void;
    protected addForeignKeySchema(foreignKey: ForeignKeySchema): void;
    dropColumn(name: string): this;
    renameColumn(from: string, to: string): this;
    dropIndex(name: string): this;
    dropUnique(name: string): this;
    renameIndex(from: string, to: string): this;
    dropForeign(name: string): this;
    primary(columns: string[]): this;
    dropPrimary(name?: string): this;
    markColumnAsModified(column: SchemaColumnBuilder): void;
    toStatements(): string[];
    private operationStatements;
}
export declare class SchemaColumnBuilder {
    readonly name: string;
    private readonly type;
    private readonly size?;
    private readonly scale?;
    private readonly addDefaultIndex?;
    private readonly addNamedIndex?;
    private readonly addNamedUniqueIndex?;
    private readonly addForeignKey?;
    private nullableValue;
    private primaryKeyValue;
    private unsignedValue;
    private autoIncrementValue;
    private defaultValueValue;
    private defaultExpressionValue;
    private onUpdateExpressionValue;
    private enumValuesValue;
    private enumTypeNameValue;
    private afterColumnValue;
    private changeCallback;
    constructor(name: string, type: string, size?: number | undefined, scale?: number | undefined, addDefaultIndex?: (() => void) | undefined, addNamedIndex?: ((name: string) => void) | undefined, addNamedUniqueIndex?: ((name: string | undefined) => void) | undefined, addForeignKey?: ((referencedColumn: string) => SchemaForeignKeyBuilder) | undefined);
    get isPrimaryKey(): boolean;
    primary(): this;
    nullable(value?: boolean): this;
    notNull(): this;
    unsigned(value?: boolean): this;
    autoIncrement(value?: boolean): this;
    default(value: string | number | boolean | null): this;
    defaultRaw(expression: string): this;
    onUpdate(expression: string): this;
    index(indexName?: string): this;
    unique(indexName?: string): this;
    references(referencedColumn: string): SchemaForeignKeyBuilder;
    change(): this;
    after(columnName: string): this;
    first(): this;
    setEnumValues(values: readonly string[], typeName?: string): void;
    setChangeCallback(callback: () => void): void;
    toSchema(ordinalPosition: number): ColumnSchema;
}
export declare class SchemaForeignKeyBuilder {
    private readonly foreignKey;
    constructor(foreignKey: ForeignKeySchema);
    references(column: string): this;
    referencesAll(columns: string[]): this;
    on(table: string): this;
    onDelete(action: string): this;
    onUpdate(action: string): this;
    name(name: string): this;
}
export {};
//# sourceMappingURL=schema.d.ts.map