Hi everyone! Is there a way to log the generated S...
# orm-help
p
Hi everyone! Is there a way to log the generated SQL in a text file? Background: We build some complex data migration from the old data source to the new Prisma based Postgresql DB. All writes to the new DB are done via Prisma Client. However, not everybody in the dev team can run this data migration, esp on their local dev machines as this requires access to the old database. So I would like to generate a seed data SQL file - and it would be easiest by simply logging all the INSERT and UPDATE statements triggered by Prisma... Thanks
r
Yes you can, using event based logging, output the queries to a file when they are fetched in the event 🙂
p
@Ryan Thanks! Is this also showing the values of the parameters being passed in?
As far as I remember, the output only shows
$1
- but I cannot see, what value is used for
$1
...
r
Nope that won’t be shown. I guess it’s for security reasons that only the prepared statement and not the final values are shown.
p
😞
I guess than I'll have to dig into Postgres and see if there is some way to log it
👍 1