Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface for query options

see

Options

Hierarchy

Index

Properties

Optional bind

bind: Object | string[]

Either an object of named bind parameter in the format $param or an array of unnamed bind parameter to replace $1, $2, ... in your SQL.

Optional fieldMap

fieldMap: object

Type declaration

  • [key: string]: string

Optional instance

instance: Instance<any>

A sequelize instance used to build the return instance

Optional logging

logging: boolean | Function

A function that gets executed while running the query to log the sql.

Optional mapToModel

mapToModel: boolean

Map returned fields to model's fields if options.model or options.instance is present. Mapping will occur before building the model instance.

Optional model

model: Model<any, any>

A sequelize model used to build the returned model instances (used to be called callee)

Optional nest

nest: boolean

If true, transforms objects with . separated property names into nested objects using dottie.js. For example { 'user.username': 'john' } becomes { user: { username: 'john' }}. When nest is true, the query type is assumed to be 'SELECT', unless otherwise specified

Defaults to false

Optional plain

plain: boolean

Sets the query type to SELECT and return a single row

Optional raw

raw: boolean

If true, sequelize will not try to format the results of the query, or build an instance of a model from the result

Optional replacements

replacements: Object | string[]

Either an object of named parameter replacements in the format :param or an array of unnamed replacements to replace ? in your SQL.

Optional retry

retry: object

Set of flags that control when a query is automatically retried.

Type declaration

  • Optional match?: string[]
  • Optional max?: number

Optional returning

returning: boolean

Append RETURNING * to get back auto generated values (Postgres only)

Optional searchPath

searchPath: string

An optional parameter to specify the schema search_path (Postgres only)

Optional supportsSearchPath

supportsSearchPath: boolean

If false do not prepend the query with the search_path (Postgres only)

Optional transaction

transaction: Transaction

Transaction to run query under

Optional type

type: string

The type of query you are executing. The query type affects how results are formatted before they are passed back. The type is a string, but Sequelize.QueryTypes is provided as convenience shortcuts.

Optional useMaster

useMaster: boolean

Force the query to use the write pool, regardless of the query type.

Defaults to false

Generated using TypeDoc