Closed slobo closed 7 years ago
When running migrations, the migration queries are passed to DBI as a single string, and any error message that is returned is already being passed on. I'm afraid I don't know of any way to get more detailed information in this instance. Storing string and file metadata does not sound worth the effort and cost, even if it was possible.
Currently, if there is an SQL error in a migration step, we get the error from DBD, but we can't point where it is in the migration file, eg:
schema.sql
:app.pl
:Error:
Using
MOJO_MIGRATIONS_DEBUG
does show which SQL is being executed, but it would be useful to pinpoint the source of trouble, having something like this in the error:I don't know if
DBD
can even give us this info; I do know thatsqlite3 -init schema.sql mydb
will show line numbers, so hopefully this is available to the driver when sending queries too.Is this functionality something you would be interested in? Looking at from_file (and
from_string
) it seems we would require a bit of surgery to save some metadata as migration file and strings are parsed in order to reconstruct exact source of trouble, but I don't mind giving it a go if it stands a chance of being accepted.Thanks