import { Constructable } from "../util.ts"; import { SelectSqlGenerator } from "./select_chain.ts"; import { UpdateSqlGenerator } from "./update_chain.ts"; import { DeleteFromSqlGenerator } from "./delete_chain.ts"; import { InsertIntoSqlGenerator } from "./insert_chain.ts"; /** * @public */ export interface ChainCTE { as(statement: Constructable): ChainCTE; as(name: string, statement: Constructable): ChainCTE; select: SelectSqlGenerator; update: UpdateSqlGenerator; deleteFrom: DeleteFromSqlGenerator; insertInto: InsertIntoSqlGenerator; toString(): string; } /** * @public * @example * ```ts * * //WITH cte1 AS(SELECT * FROM table1) * * withAs("cte1","SELECT * FROM table1") * withAs("cte1",() => "SELECT * FROM table1") * * withAs(() => "cte1 AS(SELECT * FROM table1)") * withAs("cte1 AS(SELECT * FROM table1)") * ``` */ export declare function withAs(statement: Constructable): ChainCTE; /** @public */ export declare function withAs(name: string, statement: Constructable): ChainCTE; /** * @public * @example * ```ts * * //WITH RECURSIVE cte1 AS(SELECT * FROM table1) * * withRecursiveAs("cte1","SELECT * FROM table1") * withRecursiveAs("cte1",() => "SELECT * FROM table1") * * withRecursiveAs(() => "cte1 AS(SELECT * FROM table1)") * withRecursiveAs("cte1 AS(SELECT * FROM table1)") * ``` */ export declare function withRecursiveAs(statement: Constructable): ChainCTE; /** @public */ export declare function withRecursiveAs(name: string, statement: Constructable): ChainCTE;