feat(aws): RDS Aurora Drizzle support — Data API migrations + runtime binding#640
Open
sam-goodwin wants to merge 1 commit into
Open
feat(aws): RDS Aurora Drizzle support — Data API migrations + runtime binding#640sam-goodwin wants to merge 1 commit into
sam-goodwin wants to merge 1 commit into
Conversation
… binding - AWS.RDS.Schema: deploy-time migration applier over the RDS Data API (HTTPS+IAM, no VPC reachability needed), with a writer-readiness wait - AWS.RDSData.drizzle: runtime Drizzle client backed by the Data API - AWS.RDS.connectionString: postgres:// binding for Drizzle.postgres - proxyChainPromise: promise-aware chain for the aws-data-api driver - fixes surfaced by live e2e testing: - Aurora: don't set vpcSecurityGroupIds on cluster-member instances - Lambda runtime: provide per-invocation ExecutionContext - EC2.Network: resolve AWSEnvironment lazily so it survives runtime re-exec - example: aws-lambda-rds-aurora-drizzle (live-tested end to end) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Install the packages built from this commit: alchemy bun add alchemy@https://pkg.ing/alchemy/477397c@alchemy.run/better-auth bun add @alchemy.run/better-auth@https://pkg.ing/@alchemy.run/better-auth/477397c@alchemy.run/pr-package bun add @alchemy.run/pr-package@https://pkg.ing/@alchemy.run/pr-package/477397c |
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.
Brings AWS RDS Aurora to feature parity with the Neon/Planetscale providers: deploy-time Drizzle migrations and a runtime Drizzle client, both over the RDS Data API (HTTPS+IAM, no VPC reachability required from the deploy machine or the function).
New surface
AWS.RDS.Schema— appliesDrizzle.Schemaoutput (or hand-authored SQL) to a cluster viards-dataexecuteStatement/transactions, tracked idempotently. Mirrors Neon's hash-gated diff/reconcile. Waits for the writer instance before applying (a fresh Aurora deploy races cluster-vs-instance availability).AWS.RDSData.drizzle/dataApi— the AWS analog ofDrizzle.postgres, returning a chainable proxy whose query buildersyield*directly. IAM is attached at deploy via the existing RDSData policies; the runtime client uses@aws-sdk/client-rds-data(added as an optional peer dep).AWS.RDS.connectionString— apostgres://binding for theDrizzle.postgrespath, with a JSDoc recipe for fronting Aurora with Cloudflare Hyperdrive.proxyChainPromise—proxyChainvariant that wraps the aws-data-api driver's promise-based query builders into Effects (the effect-postgres driver is already Effect-native; the data-api one is not).Framework fixes surfaced by live e2e testing
These were latent bugs in the AWS Lambda runtime path (a function's resource layer re-executes on cold start):
AWS/Lambda/Function.ts— provide a per-invocationExecutionContext(scope + cache), matchingWorkerBridge, soDrizzle.postgres/AWS.RDSData.drizzlememoization works in Lambda.AWS/EC2/Network.ts— resolveAWSEnvironment.currentlazily (only when gateway endpoints are requested); it isn't provided at runtime, so the eager read crashed any function bound to a VPC-backed resource.Example
examples/aws-lambda-rds-aurora-drizzle—Drizzle.Schema→AWS.RDS.Schema→ a Lambda doing user CRUD viaAWS.RDSData.drizzle. Verified end to end against real AWS (deploy → migrate → CRUD incl. relational query → destroy, all green).