I'm currently working on a greenfield project using Node.js with TypeScript and I'm trying to implement DSQL. Although I've tried using Drizzle, it doesn't seem to support migrations with DSQL. I also considered Kysely, but I've run into issues since their migrations rely on a locking table (pg_advisory_xact_lock) that doesn't exist in DSQL. My concern is that manually creating tables with raw SQL could be a hassle, especially since I expect frequent schema changes. Has anyone had success with this setup or have any advice on how to handle migrations with DSQL?
4 Answers
For migrations, I’m currently using dbmate with Kysely, which avoids the issues you mentioned. You might find it works for your situation since it doesn’t rely on DSQL's locking table.
Yeah, DSQL just became generally available recently, so it's likely that more ORMs will take some time to catch up and fully support it. You might just need to be patient for a bit longer as they roll out updates.
Our team has been using Liquibase and sqlx for migrations, which is working well. Just keep in mind that DSQL's DDL is designed for scalability, so for creating indexes, you need to use the async keyword. This means you can't perform DDL and DML in the same transaction, as the index creation is handled asynchronously.
I think as more developers start to adopt DSQL, more ORMs will expand their support. Keeping an eye on updates from the ORM maintainers might be helpful for you.
Is it working well with DSQL for you?