sequelize-sscce icon indicating copy to clipboard operation
sequelize-sscce copied to clipboard

Hooks triggered by sequelize.query

Open Rochet2 opened this issue 3 years ago • 0 comments

This example demonstrates how sequelize.query does not trigger any hooks even if model and type are defined. Hooks are printed when called. But the example shows that no hooks are printed between "Start" and "End".

Example output:

Start
[Sequelize] Executed (default): SELECT * FROM "Foos" [Elapsed time: 1 ms] 

[ Foo {
    dataValues: { id: 1, name: 'bar' },
    _previousDataValues: { id: 1, name: 'bar' },
    uniqno: 1,
    _changed: Set {},
    _options:
     { isNewRecord: false,
       _schema: null,
       _schemaDelimiter: '',
       raw: true,
       attributes: undefined },
    isNewRecord: false },
  Foo {
    dataValues: { id: 2, name: 'baz' },
    _previousDataValues: { id: 2, name: 'baz' },
    uniqno: 1,
    _changed: Set {},
    _options:
     { isNewRecord: false,
       _schema: null,
       _schemaDelimiter: '',
       raw: true,
       attributes: undefined },
    isNewRecord: false } ]
End

Rochet2 avatar Sep 23 '22 11:09 Rochet2