Skip to content

Option to print the exact query sent to the database before running it #3207

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

Open
pdenapo opened this issue Feb 17, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@pdenapo
Copy link

pdenapo commented Feb 17, 2024

What do you want to change?

This feature would be very useful for debugging, and would help to improve the quality of
sqlc itself.

I am getting a strange message "incomplete input" (using sqlite in go) from a query with parameters, and it is really difficult to find out what is really happend without his feature.

What database engines need to be changed?

SQLite

What programming language backends need to be changed?

Go

@pdenapo pdenapo added enhancement New feature or request triage New issues that hasn't been reviewed labels Feb 17, 2024
@achintya-7
Copy link

achintya-7 commented Feb 25, 2024

I believe, the respective SQL driver handles the query formation and execution. I often log out the arguments/params of the query before the actual query at the debug level.
Maybe parsing the query string and populating the $1 or ? with the respective arguments can form the query beforehand.

@kyleconroy kyleconroy removed the triage New issues that hasn't been reviewed label Aug 5, 2024
@Akkarine
Copy link

Akkarine commented May 1, 2025

I'm also voting for this feature - could be useful for scripts with --dry-run option.

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

No branches or pull requests

4 participants