import type { BuildColumns } from "../column-builder.js";
import { entityKind } from "../entity.js";
import type { TypedQueryBuilder } from "../query-builders/query-builder.js";
import type { AddAliasToSelection } from "../query-builders/select.types.js";
import type { ColumnsSelection, SQL } from "../sql/sql.js";
import type { CockroachColumnBuilderBase } from "./columns/common.js";
import { QueryBuilder } from "./query-builders/query-builder.js";
import { CockroachViewBase } from "./view-base.js";
export declare class DefaultViewBuilderCore<TConfig extends {
    name: string;
    columns?: unknown;
}> {
    protected name: TConfig['name'];
    protected schema: string | undefined;
    static readonly [entityKind]: string;
    readonly _: {
        readonly name: TConfig['name'];
        readonly columns: TConfig['columns'];
    };
    constructor(name: TConfig['name'], schema: string | undefined);
}
export declare class ViewBuilder<TName extends string = string> extends DefaultViewBuilderCore<{
    name: TName;
}> {
    static readonly [entityKind]: string;
    as<TSelectedFields extends ColumnsSelection>(qb: TypedQueryBuilder<TSelectedFields> | ((qb: QueryBuilder) => TypedQueryBuilder<TSelectedFields>)): CockroachViewWithSelection<TName, false, AddAliasToSelection<TSelectedFields, TName, 'cockroach'>>;
}
export declare class ManualViewBuilder<TName extends string = string, TColumns extends Record<string, CockroachColumnBuilderBase> = Record<string, CockroachColumnBuilderBase>> extends DefaultViewBuilderCore<{
    name: TName;
    columns: TColumns;
}> {
    static readonly [entityKind]: string;
    private columns;
    constructor(name: TName, columns: TColumns, schema: string | undefined);
    existing(): CockroachViewWithSelection<TName, true, BuildColumns<TName, TColumns, 'cockroach'>>;
    as(query: SQL): CockroachViewWithSelection<TName, false, BuildColumns<TName, TColumns, 'cockroach'>>;
}
export declare class MaterializedViewBuilderCore<TConfig extends {
    name: string;
    columns?: unknown;
}> {
    protected name: TConfig['name'];
    protected schema: string | undefined;
    static readonly [entityKind]: string;
    _: {
        readonly name: TConfig['name'];
        readonly columns: TConfig['columns'];
    };
    constructor(name: TConfig['name'], schema: string | undefined);
    protected config: {
        withNoData?: boolean;
    };
    withNoData(): this;
}
export declare class MaterializedViewBuilder<TName extends string = string> extends MaterializedViewBuilderCore<{
    name: TName;
}> {
    static readonly [entityKind]: string;
    as<TSelectedFields extends ColumnsSelection>(qb: TypedQueryBuilder<TSelectedFields> | ((qb: QueryBuilder) => TypedQueryBuilder<TSelectedFields>)): CockroachMaterializedViewWithSelection<TName, false, AddAliasToSelection<TSelectedFields, TName, 'cockroach'>>;
}
export declare class ManualMaterializedViewBuilder<TName extends string = string, TColumns extends Record<string, CockroachColumnBuilderBase> = Record<string, CockroachColumnBuilderBase>> extends MaterializedViewBuilderCore<{
    name: TName;
    columns: TColumns;
}> {
    static readonly [entityKind]: string;
    private columns;
    constructor(name: TName, columns: TColumns, schema: string | undefined);
    existing(): CockroachMaterializedViewWithSelection<TName, true, BuildColumns<TName, TColumns, 'cockroach'>>;
    as(query: SQL): CockroachMaterializedViewWithSelection<TName, false, BuildColumns<TName, TColumns, 'cockroach'>>;
}
export declare class CockroachView<TName extends string = string, TExisting extends boolean = boolean, TSelectedFields extends ColumnsSelection = ColumnsSelection> extends CockroachViewBase<TName, TExisting, TSelectedFields> {
    static readonly [entityKind]: string;
    constructor({ config }: {
        config: {
            name: TName;
            schema: string | undefined;
            selectedFields: ColumnsSelection;
            query: SQL | undefined;
        };
    });
}
export type CockroachViewWithSelection<TName extends string = string, TExisting extends boolean = boolean, TSelectedFields extends ColumnsSelection = ColumnsSelection> = CockroachView<TName, TExisting, TSelectedFields> & TSelectedFields;
export declare const CockroachMaterializedViewConfig: unique symbol;
export declare class CockroachMaterializedView<TName extends string = string, TExisting extends boolean = boolean, TSelectedFields extends ColumnsSelection = ColumnsSelection> extends CockroachViewBase<TName, TExisting, TSelectedFields> {
    static readonly [entityKind]: string;
    readonly [CockroachMaterializedViewConfig]: {
        readonly withNoData?: boolean;
    } | undefined;
    constructor({ cockroachConfig, config }: {
        cockroachConfig: {
            withNoData: boolean | undefined;
        } | undefined;
        config: {
            name: TName;
            schema: string | undefined;
            selectedFields: ColumnsSelection;
            query: SQL | undefined;
        };
    });
}
export type CockroachMaterializedViewWithSelection<TName extends string = string, TExisting extends boolean = boolean, TSelectedFields extends ColumnsSelection = ColumnsSelection> = CockroachMaterializedView<TName, TExisting, TSelectedFields> & TSelectedFields;
export declare function cockroachView<TName extends string>(name: TName): ViewBuilder<TName>;
export declare function cockroachView<TName extends string, TColumns extends Record<string, CockroachColumnBuilderBase>>(name: TName, columns: TColumns): ManualViewBuilder<TName, TColumns>;
export declare function cockroachMaterializedView<TName extends string>(name: TName): MaterializedViewBuilder<TName>;
export declare function cockroachMaterializedView<TName extends string, TColumns extends Record<string, CockroachColumnBuilderBase>>(name: TName, columns: TColumns): ManualMaterializedViewBuilder<TName, TColumns>;
export declare function isCockroachView(obj: unknown): obj is CockroachView;
export declare function isCockroachMaterializedView(obj: unknown): obj is CockroachMaterializedView;
