-
Notifications
You must be signed in to change notification settings - Fork 821
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
NEW Add a trace comment for queries in dev mode #11065
NEW Add a trace comment for queries in dev mode #11065
Conversation
c2c42fb
to
0a04b7c
Compare
mariadb failure is unrelated. |
0a04b7c
to
b1934f5
Compare
Rebased to resolve that old mariadb failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try installing debugbar - it also shows where sql originated from, though in some cases there were different results
Either this is correct and debugbar is wrong, or vice versa
Also there were some cases where debugbar was getting the source from and this wasn't
Possibly just copy whatever debugbar does?
Also probably exclude running this code if debugbar is running, as there's no need to output where the call originates from twice
Looks like both were wrong 😅
I've identified a couple of scenarios where that happens - one is
I'm not going to add coupling from framework to debugbar. I'll was going to open a card in debugbar to strip these comments since it has its own way of pointing to the query origin - but now that this PR introduces config to opt into the trace comment, developers should just not opt in if they're using debugbar. |
f48e21c
to
f1eecdd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed a handful of queries not getting comments when running ?showqueries=1 inside the cms
0008: SELECT "Code" FROM "Permission" WHERE "Type" = 1 AND "GroupID" IN (2) UNION SELECT "Code" FROM "PermissionRoleCode" PRC INNER JOIN "PermissionRole" PR ON PRC."RoleID" = PR."ID" INNER JOIN "Group_Roles" GR ON GR."PermissionRoleID" = PR."ID" WHERE "GroupID" IN (2) 0.0003s
0009: SELECT "Code" FROM "Permission" WHERE "Type" = -1 AND "GroupID" IN (2) 0.0001s
0014: SELECT "ID", "Version" FROM "SiteTree" 0.0001s
0015: SELECT "ID", "Version" FROM "SiteTree_Live" 0.0001s
Also I think this is worth being to be able to enable via an environment variable so that platform engineers can switch it on more easily
a3bc8b6
to
e07fcb4
Compare
I've removed the |
I addressed that in #11065 (comment)
Done |
e07fcb4
to
bcdeff5
Compare
Issue