Closed Sleepful closed 1 month ago
Tried it. Worked for me. Also, we have tests.
@koskimas What should the error look like on the terminal?
I am running on Deno with PostgresJS driver, I noticed even failure to connect to DB was not creating an error with a stack trace, it was just terminating the process.
This is without putting try/catch around the code.
I don't see tests that cover this scenario though.
Hey 👋
By design.
const { error, results } = await migrator.migrateToLatest()
if (error) {
// ...
}
@igalklebanov thank you! I must have missed this bit.
I was just going to comment how the error can be caught inside the migration file itself but not outside.
Got it!
Btw, we have a new CLI in the works. https://github.com/kysely-org/kysely-ctl
Try it out.
I must have missed this bit.
It's the first thing we mention in the docs. You can also just hover over the function to see the docs.
Yeah it's my bad guys, sorry 😅 In part because I was rewriting the code to work well with Deno so I was a little distracted. I want to push a PR for docs with my Deno code soon to make it up to you both.
Simple example:
Adding a new column with
(col) => col.setNotNull(),
to a table that already has rows will fail, because the existing rows will have null values. This is OK.However, the failure does not create any kind of error, it just fails silently, which makes it difficult to debug.
My migrations are ran with
await migrator.migrateToLatest();