Adds support for read replicas https://orm.drizzle.team/docs/read-replicas that can be used to offload read-heavy traffic. To use (both `db-postgres` and `db-vercel-postgres` are supported): ```ts import { postgresAdapter } from '@payloadcms/db-postgres' database: postgresAdapter({ pool: { connectionString: process.env.POSTGRES_URL, }, readReplicas: [process.env.POSTGRES_REPLICA_URL], }) ``` --------- Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
Payload Postgres Adapter
Official Postgres adapter for Payload.
Installation
npm install @payloadcms/db-postgres
Usage
import { buildConfig } from 'payload'
import { postgresAdapter } from '@payloadcms/db-postgres'
export default buildConfig({
db: postgresAdapter({
pool: {
connectionString: process.env.DATABASE_URI,
},
}),
// ...rest of config
})
More detailed usage can be found in the Payload Docs.