ameingast / postgresql-simple-migration

PostgreSQL Schema Migrations for Haskell
Other
85 stars 48 forks source link

More verbosity would help track script issues #22

Closed adfretlink closed 6 years ago

adfretlink commented 7 years ago

Currently, errors on running script will get you a pretty printed sql exception, which is nice. However, the particular query that failed is not printed, nor the script that was run. I'd be more than happy to write a PR to display these in case of error, if that's ok with you.

ameingast commented 7 years ago

Absolutely! Thanks for contributing!

adfretlink commented 6 years ago

Sorry for the delay, I had less time to contribute that I hoped for. Here's a PR with my solution to this problem: https://github.com/ameingast/postgresql-simple-migration/pull/23

ameingast commented 6 years ago

Sorry this took so long, but I'm not merging this, because the changes could potentially break existing deployments.

The solution would work if it was a complete (Postgres) SQL parser that properly separates statements. I'm not confident that this solution can handle all complex SQL statements.

A workaround for your issue would be to split up SQL statements into separate files.