feat: Aurora Serverless / RDS Data API database adapter
Summary
Add an official Postgres-flavoured adapter that talks to Amazon Aurora Serverless v2 and Amazon RDS through the RDS Data API instead of a TCP connection pool. This lets a Payload deployment run with zero open database connections for a truly serverless infrastructure.
Proposed package: @payloadcms/db-aurora-serverless (name up for bikeshed; @payloadcms/db-aws-data-api is the alternative). It reuses virtually all of @payloadcms/drizzle/postgres for schema/query/CRUD logic and only swaps the Drizzle driver + connection lifecycle.
Motivation
Payload's postgresAdapter only accepts a pool (pg.PoolConfig) and always builds a node-postgres pool. Aurora Serverless v2 auto-pause requires no established connections; any long-lived pool (including a pool that holds one idle client) keeps the instance awake and defeats the cost saving that is the whole reason to use Serverless v2.
Drizzle already ships a first-class driver for the Data API (drizzle-orm/aws-data-api/pg). This proposal surfaces that driver through a Payload adapter with the same Payload-level surface as postgresAdapter.
Requested API from the discussion (adapted to the separate-package design):
import { auroraServerlessAdapter } from '@payloadcms/db-aurora-serverless'
export default buildConfig({
db: auroraServerlessAdapter({
connection: {
database: process.env.DATABASE!,
secretArn: process.env.SECRET_ARN!,
resourceArn: process.env.RESOURCE_ARN!,
region: process.env.AWS_REGION!,
},
}),
})References
- Discussion: https://github.com/payloadcms/payload/discussions/10566
- Drizzle AWS Data API driver docs: https://orm.drizzle.team/docs/connect-aws-data-api
- AWS RDS Data API: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html
- Existing sibling adapter:
packages/db-vercel-postgres
Source: payloadcms/payload