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: Output SQL Queries with Parameters #94

Closed
kz-d opened this issue Jul 7, 2023 · 1 comment · Fixed by #99
Closed

Feature Request: Output SQL Queries with Parameters #94

kz-d opened this issue Jul 7, 2023 · 1 comment · Fixed by #99

Comments

@kz-d
Copy link
Contributor

kz-d commented Jul 7, 2023

Thank you for developing this useful tool!

I've been looking for a way to output SQL queries along with their parameters.
Currently, the verboseQuery option does allow for SQL logs to be outputted, but it doesn't include the parameters.

A possible workaround could be the following code snippet, but it tends to be a bit clunky and output some unnecessary logs.

beforeAll(async () => {
   jestPrisma.originalClient.$on("query", (event) => {
      console.debug({ event })
   })
})

prisma/prisma#5026

Since this is a tool for testing, how about adding an option like verboseQueryWithParameters or making it default to output parameters?

If that's acceptable, I will create a pull request.

@kz-d
Copy link
Contributor Author

kz-d commented Aug 29, 2023

HI @Quramy
Would you have a moment to revisit this feature request? It seems to have garnered some positive reactions.

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

Successfully merging a pull request may close this issue.

1 participant