type ResultCollection = | "last_statement_all_rows" | "last_statement_first_row" | "last_statement_all_rows_scalar" | "last_statement_first_row_scalar" | "all_statements_all_rows" | "all_statements_first_row" | "all_statements_all_rows_scalar" | "all_statements_first_row_scalar" | "legacy"; type FetchParams = { resultCollection?: ResultCollectionT; }; type SqlResult = ResultCollectionT extends "last_statement_first_row" ? object : ResultCollectionT extends "all_statements_first_row" ? object[] : ResultCollectionT extends "last_statement_all_rows" ? object[] : ResultCollectionT extends "all_statements_all_rows" ? object[][] : ResultCollectionT extends "last_statement_all_rows_scalar" ? any[] : ResultCollectionT extends "all_statements_all_rows_scalar" ? any[][] : ResultCollectionT extends "last_statement_first_row_scalar" ? any : ResultCollectionT extends "all_statements_first_row_scalar" ? any[] : unknown; export type SqlStatement = { content: string; args: Record; fetch( params?: FetchParams // The union is for auto-completion ): Promise>; fetchOne( params?: Omit, "resultCollection"> ): Promise>; }; export interface SqlTemplateFunction { (strings: TemplateStringsArray, ...values: any[]): SqlStatement; } export declare function datatable(name: string): SqlTemplateFunction; export declare function ducklake(name: string): SqlTemplateFunction;