Add a sql comment to generated queries #15382
|
Hi! Thanks for a great ORM! I'm looking at sqlcommenter for adding some metadata through sql comments which can then be interpreted by Google Query Insights. I've looked at the long list of hooks, but didn't really understand which ones could help me, if any of them can. Ideally I would like to:
Is there anything like that? Or any nice way to tag on an sql comment for all queries at least? (for the latter I wouldn't get JS function name but still get the cloud function name which would improve things for us a lot) (There is a wrapper for sequelize in the sqlcommenter repo, but I'd like to know if it's possible to do without wrapping sequelize and also because the wrapper doesn't fit my needs) |
Replies: 1 comment 2 replies
|
Hi :) I'm not familiar with how Query Insights works, however:
|
Hi :)
I'm not familiar with how Query Insights works, however:
beforeQueryhook, but it looks like that's not true: https://github.com/sequelize/sequelize/blob/main/src/sequelize.js#L709-L712. The SQL is made available afterbeforeQuery. If this is what you need, don't hesitate to open a feature request. Looks like sqlcommenter worked around it by wrapping ourQuery.runmethod 😅