GenerateResult
The return value of every query's .generate(options?) method. See
Generating SQL per dialect.
interface GenerateResult {
sql: string;
params?: any;
paramOptions?: Record<string, ParamOptions> | ParamOptions[];
returningFields?: { field: string; alias?: string }[];
}
Properties
| Key | Type | Description |
|---|---|---|
sql | string | The rendered SQL text. |
params | any | undefined | The prepared bind-parameter values actually referenced by the query (a subset of the params you passed in, keyed by parameter name). |
paramOptions | Record<string, ParamOptions> | ParamOptions[] | undefined | Per-parameter ParamOptions (dataType/isArray) metadata. |
returningFields | { field: string; alias?: string }[] | undefined | Populated when .returning(...) was used (Insert/Update); lists the requested field/alias pairs. Built from ReturningColumn instances. |
import '@sqb/postgres-dialect';
import { Select } from '@sqb/builder';
const { sql, params } = Select('id').from('customers').generate({ dialect: 'postgres' });