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

Support for sqlcommenter: Option to Not Strip SQL Comments #480

Closed
mgreenw opened this issue Apr 5, 2023 · 2 comments
Closed

Support for sqlcommenter: Option to Not Strip SQL Comments #480

mgreenw opened this issue Apr 5, 2023 · 2 comments

Comments

@mgreenw
Copy link
Contributor

mgreenw commented Apr 5, 2023

I am trying to setup sqlcommenter in my project for use in a GCP project so that I can see queries annotated by tag. In order to dynamically add comments I ended up needing slonik-sql-tag-raw (a valid use case!) but eventually realized that all comments are being stripped from the final sql (commit: 8c505b2).

Desired Behavior

Ideally, there would be a way to opt out of this comment-stripping behavior, either globally or per-query. Perhaps this could be done with a new sql method? Or, it would be neat if sqlcommenter format was supported directly, but I understand that its pretty specific requirement.

Motivation

Currently, all comments are stripped from the final sql using pg-minify, but in some cases its necessary to include comments in the final sql so that database engines can tag queries. This is very useful when trying to monitor query performance.

@mgreenw mgreenw changed the title Option to Not Remove Comments / Support sqlcommenter Option to Not Strip SQL Comments / Support sqlcommenter Apr 5, 2023
@mgreenw mgreenw changed the title Option to Not Strip SQL Comments / Support sqlcommenter Support for sqlcommenter: Option to Not Strip SQL Comments Apr 5, 2023
@mgreenw
Copy link
Contributor Author

mgreenw commented Apr 5, 2023

Hm, looks like it may have been fixed/changed here: e1bf584#diff-84a1dc26830d43e6769bb63b218bc0a40fa720b849f17dfa53de77250eebff74L195

Still on 24.0.0 so that may just be our problem. +1 to the thoughts here: #450. I like / appreciate the changes but its been very hard to upgrade with so many breaking changes.

@gajus
Copy link
Owner

gajus commented Sep 26, 2023

Non-issue.

@gajus gajus closed this as completed Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants