Repository navigation
feat(aws/rds): apply SQL migrations on Aurora over the Data API - #2125
Open
xofromthemoon wants to merge 4 commits into
Open
xofromthemoon wants to merge 4 commits into
xofromthemoon wants to merge 4 commits into
Conversation
…lpers - Use an identity id column for every Postgres bookkeeping table; drop SqlExecutor.idColumn - DSQL batch commits each DDL alone and groups consecutive DML in one transaction - Add shared connectPgClient/withPgClient/stripSslQueryParams; move Neon, Fly, PlanetScale onto them - Extract dsqlConnectionInfo shared by ConnectHttp and DSQL migrations - DBClusterMigrations: update instead of replace, typed resume retries, rollback on commit failure - Aurora: order migrations after the writer via Output.all; reject migrations with dataApi: false
…-migrations # Conflicts: # packages/alchemy/src/AWS/DSQL/Cluster.ts # packages/alchemy/src/AWS/DSQL/Migrations.ts # packages/alchemy/src/AWS/RDS/Aurora.ts # packages/alchemy/src/Fly/PostgresMigrations.ts # packages/alchemy/src/Neon/Migrations.ts # packages/alchemy/src/Planetscale/Postgres/PostgresMigrations.ts # packages/alchemy/src/SQL/Migrations/AlchemyFormat.ts # packages/alchemy/test/AWS/DSQL/Cluster.test.ts
Replace the AWS.RDS.DBClusterMigrations resource with a migrations prop on DBInstance, applied over the cluster's Data API at the end of reconcile once the instance is available. Aurora passes migrations to its writer only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AWS.RDS.Auroranow applies SQL migrations on deploy over the RDS Data API, so the deploying machine needs no VPC access or database socket.Migrations run from the writer
DBInstance: once the instance is available, its reconcile applies them over the cluster's Data API. A hand-built cluster declares them on its writer:It uses the shared migrations pipeline: bookkeeping in
__alchemy_migrations, one-way adoption of drizzle-kit/Prisma history, and rejection of rewritten history. Each migration and its bookkeeping row commit in one Data API transaction. Deleting or replacing the instance never touches the database, and a replacement writer finds the existing bookkeeping and applies nothing twice.The Data API runs one statement per call, so put each statement in its own file or separate them with
--> statement-breakpoint(drizzle-kit's default). Declaremigrationson one instance per cluster.Aurorarejectsmigrationscombined withdataApi: false. Calls retryDatabaseResumingExceptionwhile an auto-paused Serverless v2 writer wakes up.The live test is gated behind
AWS_TEST_RDS_DBINSTANCE, because creating and deleting the cluster and writer takes about 15 minutes.