-
Notifications
You must be signed in to change notification settings - Fork 259
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Errors during migration lack line numbers #102
Comments
@AndreaCrotti depends what the error is. If it's a syntax error in the migration file, pgsanity can help find that. As for others, I would be interested in seeing more details printed out as well. For example, if I try to drop a view that has dependent views/tables it doesn't print those out, whereas running it in psql will provide me with the list of dependent objects. |
Yesterday we had a similar probelm, where dbmate was just failing on a given line without much information, but the actual error you could see from PSQL was a type mismatching, which made it immediately clear what the problem was, but no way to debug that just with the dbmate error. I guess there should be a way also with the PG go bindings to get more verbose errors right? |
Unfortunately I haven't found a way to get more useful error messages or line numbers. The I will keep this issue open because I agree it could be improved, and someone might have a clever idea to solve this. |
I've put together a proof of concept over here: But before I continue on the effort I would like to plan things out a little first so that I don't waste time doing things that won't be accepted. So my high-level plan would be:
Extra effort idea if you're open to it:
|
@silbinarywolf thanks! I will respond in the PR thread. |
Would appreciate if something of this sort is included as it improves the development experience and is a very elegant way to fix errors in an handwritten sql files. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I just noticed that if I run a
dbmate migrate
and there is an error in one of the statements, the error being printed out is a bit useless, and doesn't even contain the line number or the actual message from Postgres.I checked if there are any options for more verbosity but I don't see that either, so atm we simply don't get errors printed out?
The text was updated successfully, but these errors were encountered: