Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hooks triggered by sequelize.query #237

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Conversation

Rochet2
Copy link

@Rochet2 Rochet2 commented Sep 23, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant