Skip to content

postgrelize / QueryOptions

Type Alias: QueryOptions ​

QueryOptions = QueryOptionsBase & Readonly<{ bind?: BindParameters; mapToModel?: boolean; model?: ModelStatic<AnyModel>; nest?: boolean; plain?: boolean; raw?: boolean; replacements?: Replacements; type?: QueryType; }>

Defined in: src/query/query-result-shaper.ts:92

Options of sequelize.query, in addition to the common query options such as transaction and logging.

Example ​

ts
const rows = await sequelize.query('SELECT * FROM users WHERE id = :id', {
  type: QueryTypes.SELECT,
  replacements: { id: 1 },
  model: User,
  mapToModel: true,
});

Released under the MIT License.