Failed to run migrations: syntax error at or near ")" - how to get position of error is diesel migration? #4741
Replies: 1 comment
-
|
Due to the missing context it's almost impossible to answer anything here. It's unclear how you run migrations and which database system you are using. Assuming you use Postgres and diesel-cli there is currently no good way to get better information there. We would welcome contributions to improve that. Practically speaking the relevant error position is emitted by this part of the returned error type. What would need to be done is to convert the migration code in diesel-cli to use something like miette for error handling and construct a good error message based on the provided information there. There is sometimes also additional help in that message that might be useful to emit. We would be quite happy to see a PR for this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way to get the line number of a migration error in diesel?
The below was produced using the cli tool to run a migration containing an unknown error
I suspect it is probably not feasible to get more detailed error information from diesel. (I ended up running my migration in an external tool to find the error)
Beta Was this translation helpful? Give feedback.
All reactions