-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
Add drivers for Xata #1902
Add drivers for Xata #1902
Conversation
Signed-off-by: Alexis Rico <sferadev@gmail.com>
502bbf9
to
03227aa
Compare
Signed-off-by: Alexis Rico <sferadev@gmail.com>
Signed-off-by: Alexis Rico <sferadev@gmail.com>
await db.session.execute(sql.raw(stmt)); | ||
} | ||
|
||
rowsToInsert.push(sql`insert into ${sql.identifier(migrationsSchema)}.${sql.identifier(migrationsTable)} ("hash", "created_at") values(${migration.hash}, ${migration.folderMillis})`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depending on the results you want to see here, it may be either a good or a bad decision.
So, currently, here is what will happen:
You have 2 files with migrations (migration_1.sql
, migration_2.sql
):
- If the migration process fails after
migration_1.sql
is applied, the row in the__drizzle_migrations
table won't be created, and you will be in a situation where you have all statements from the first file applied, but nothing is stored about that in the database.
As a user, I would expect the migrator to store information about the applied migration file in the database. Therefore, perhaps you need to run this insert query here and not on lines 46-48
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the example set by Neon's HTTP migrator: https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/neon-http/migrator.ts#L37-L50
Maybe theirs should also be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, will need to change it as well, I guess I missed it on a review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Alexis Rico <sferadev@gmail.com>
Signed-off-by: Alexis Rico <sferadev@gmail.com>
Signed-off-by: Alexis Rico <sferadev@gmail.com>
Signed-off-by: Alexis Rico <sferadev@gmail.com>
@AndriiSherman Updated with the changes from #2033 |
No description provided.