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

Feature Request: Detect / Format parameters included in SQL statement #768

Open
ghedwards opened this issue Aug 18, 2024 · 2 comments
Open
Labels

Comments

@ghedwards
Copy link

Describe the Feature
Detect / Format parameters included in SQL statement

Such as
SELECT * FROM test = ?
parameters: ['foo']

Why do you want this feature?
Some tools / logging output queries with the parameters listed at the end of the statement, this enhancement would allow formatting this type of SQL anywhere without direct access to the API, like in VSCode for example.

I'm happy to help with the code on this if its likely to be merged as a pull request.

@nene
Copy link
Collaborator

nene commented Aug 19, 2024

Thanks for the feature suggestion.

I'm unsure about this. On one hand I'm cautious of supporting anything that's beyond plain SQL. On another hand various SQL dialects include stuff that's quite far from what's in SQL standard.

For start, could you perhaps name some concrete examples of the tools that produce such output. I have personally zero familiarity with such tools. And how much variance is there between different tools that do this (like do they all use the exact same syntax for this, or will there be major differences or something in between).

Regarding the implementation, at least for start I would make support of this an opt-in feature. I do welcome a pull request for this, as I'm very unlikely to implement it on my own. But I can give guidance if needed.

Last, but not least, what sort of output would you expect from the formatter when it detects these parameters?

@ghedwards
Copy link
Author

@nene tools such as Glowroot and / or Opentelemetry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants