-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Description
Issue type:
[ ] question
[ ] bug report
[x] feature request
[ ] documentation issue
Would you be open to a PR that added support for "naming" queries? I.e. something like:
Post.createQueryBuilder()
.comment(`Lookup all the posts in ${ category } category`)
.where({ category })
.getSql()
/*
-- Lookup all the posts in foo category
SELECT ...It would only be stored / used in TypeORM, obviously not submitted to the driver layer.
I've found a few times where I'm trying to diagnose a API call that makes multiple complex queries and is failing due to an SQL error. I end up trying to read the generated SQL and trying to infer where in my code that query came from. It would be nice to be able to label the queries such that I could easily trace them back when the error causes TypeORM to dump getSql() output.
michaelbromley, sgronblo, eporomaa, imnotjames, gbaronnier-wtn and 2 more