GenerateOptions
The options object accepted by every query's .generate(options?) method (Select, Insert,
Update, Delete, Union — all inherited from Query). See
Generating SQL per dialect.
interface GenerateOptions {
dialect?: string;
prettyPrint?: boolean;
params?: Record<string, any>;
dialectVersion?: string;
strictParams?: boolean;
}
Properties
| Key | Type | Default | Description |
|---|---|---|---|
dialect | string | undefined | (dialect-neutral) | Name of the target dialect (e.g. 'postgres', 'oracle', 'mssql'). Selects which registered SerializerExtensions apply. Omit it to get the builder's dialect-neutral defaults. |
prettyPrint | boolean | undefined | false | Multi-line, indented output instead of a single flattened line. |
params | Record<string, any> | undefined | undefined | Values for any Param placeholders used in the query. |
dialectVersion | string | undefined | undefined | Optional version hint (e.g. '15' for Postgres 15) a dialect extension can use to branch its output. |
strictParams | boolean | undefined | false | Converts inline literal values into auto-generated bind parameters instead of embedding them in the SQL text. See Raw SQL and Parameters. |
import { Select } from '@sqb/builder';
Select('id').from('customers').limit(10).generate({
dialect: 'postgres',
prettyPrint: true,
});