-
Notifications
You must be signed in to change notification settings - Fork 22
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
Statement Parameters are not handled correctly #25
Comments
What's the motivation for this? Pg/CRDB don't support |
Query rewriting when coding and eventually integration within an editor. I get a ton of queries that are destined not to be ingested directly, but instead used in coding. I always want those formatted correctly. Golang's db package uses
This is from here: |
I guess my point is that currently, sqlfmt's goal is to format PG SQL. |
If I have some spare cycles, I might hack away and send you a PR. This hurts the usefulness of the website when coding. |
Ok. Out of curiosity, how do you expect this to work? We'd have to teach the cockroach parser about |
I honestly haven't looked at it all, but yes, that was the idea. |
This is going to break horribly. What you really need to do is to filter the query through the Go text subtitution for question marks (which may live in lib/pq?) and the get the placeholders out of that, then parse that with sqlfmt. |
So the detail of why it will break:
|
I also forgot to mention that a standalone |
The common ones that I can think of are:
?
$0
,$1
...%0
,%1
...I guess, it's probably best to handle
?
,$
,%
with and without numbers.e.g.
The text was updated successfully, but these errors were encountered: