ParamOptions
Per-parameter metadata describing a bind parameter's native type, surfaced on
GenerateResult.paramOptions after .generate(). Adapters that bind
values with an explicit native type (rather than relying on driver inference) read this to decide
how to bind each parameter.
interface ParamOptions {
dataType?: DataType;
isArray?: boolean;
}
Properties
| Key | Type | Default | Description |
|---|---|---|---|
dataType | DataType | undefined | undefined | The parameter's data-type hint, taken from the matching Param/Field's _dataType. |
isArray | boolean | undefined | undefined | Whether the parameter binds an array value. |
import { Select, Eq, Param, DataType } from '@sqb/builder';
const result = Select()
.from('customers')
.where(Eq('id', Param('id', DataType.INTEGER)))
.generate({ params: { id: 1 } });
result.paramOptions; // { id: { dataType: 'INTEGER' } } (or an array form, depending on the query)