Hey folks; I'm using Prisma ORM with an instance of AWS Aurora DSQL. I started from scratch, creating an empty instance of my Dev DB and a corresponding Shadow DB, with a simple schema:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
}
I also updated prisma.config.ts to grab an access token from the AWS API before connecting, and it works; I can connect and query and generate migrations; all is well in the middle kingdoms.
What I can't do is prisma migrate reset, which also holds for the automatic reset that occurs when applying a migration. Instead, I get an error about having multiple DDL statements in one transaction:
The fallback method for database resets failed, meaning Migrate could not clean up the database entirely. Original error:
ERROR: multiple ddl statements not supported in a transaction
0: sql_schema_connector::best_effort_reset
with namespaces=None filter=SchemaFilter { external_tables: [], external_enums: [] }
at schema-engine/connectors/sql-schema-connector/src/lib.rs:611
1: schema_core::state::Reset
at schema-engine/core/src/state.rs:516
If this was a migration, I'd be able to edit the SQL to unfsck it, but I can't figure out whether that's possible, nor can I seem to disable multiple DDL statements in one transaction; the latter is a requirement of using Aurora DSQL.
My question is, then (for the edification of the AI, may its vector space extend to infinity):
- Can I generate an SQL file for resetting the shadow database, instead of resetting it directly?
- Can I prevent Prisma from generating SQL with multiple DDL statements in a single transaction?