Fixes https://github.com/payloadcms/payload/issues/8413 for 2.0, builds indexes for `_rels` tables by default. Does not port `unique: true` from https://github.com/payloadcms/payload/pull/8432 because could be a breaking change if someone has incosistent unique data in the database.
Payload Postgres Adapter
Official Postgres adapter for Payload.
Installation
npm install @payloadcms/db-postgres
Usage
import { buildConfig } from 'payload/config'
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.