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

Query logging #181

Open
tonyxiao opened this issue May 17, 2023 · 1 comment
Open

Query logging #181

tonyxiao opened this issue May 17, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@tonyxiao
Copy link

Right now if there is an error it is really hard to track down which specific line caused the sql error (even something as basic as syntax). Would love to have logging for every statement that is executed and highlight for the problematic statements.

@benjie benjie added the enhancement New feature or request label May 19, 2023
@benjie
Copy link
Member

benjie commented May 19, 2023

Graphile Migrate reads the file on the disk and then issues it to the database, it does not parse it and split it into individual statements (doing so is more complex than you might think thanks to the $<blah>$ string delimiters that Postgres uses). If the error comes back with details, we do try and tie those back to the relevant line in the source (see https://github.com/graphile/migrate/blob/main/src/instrumentation.ts ) but we can only do that when there's enough data.

Further, we don't currently support this well when you're using a current/ folder rather than a current.sql file - we effectively turn the current/ folder into a single SQL string and then locate the error in that - we don't currently map it back to the separate files.

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

2 participants