Skip to main content

QueryOptions

Extends DataMappingOptions

KeyTypeDefaultDescription
autoCommitbooleantrueSpecifies whether to execute the query in auto-commit mode
objectRowsbooleanfalseSpecifies whether rows are fetched as <FieldName, Value> pair objects or as arrays of values. Deprecated in favor of rowDecoder, which still works
rowDecoder'array' | 'object' | RowDecoderSelects how a row's raw wire data is turned into a value: the built-in array/object shapes, or a custom RowDecoder subclass. Wins over objectRows when both are set
typeMapDataTypeMapGlobalTypeMapData type map instance
cursorbooleanIf true, returns a Cursor instance instead of rows
params(BindParam | any)[]Query execution parameters
columnFormatDataFormat | DataFormat[]DataFormat.binarySpecifies the transfer format (binary or text) for each column
fetchCountnumber100Specifies how many rows will be fetched. For a Cursor, this value specifies how many rows will be fetched per batch
rollbackOnErrorbooleantrueWhen off, if a statement in a transaction block generates an error, the error is ignored and the transaction continues. When on (the default), a statement in a transaction block that generates an error aborts the entire transaction
signalAbortSignalAborts the call when the signal fires: the running statement is cancelled on the server and the promise rejects with the signal's own reason, with the database error attached as cause. Cancelling is a request rather than a guarantee — the call settles when the server has actually finished, not the moment abort() is called. AbortSignal.timeout(ms) gives a per-call timeout
asyncErrorHandlingbooleanthe connection's own settingOverrides the connection's own asyncErrorHandling for this call only — see DatabaseConnectionParams.asyncErrorHandling