Adjust drizzle init for changes in drizzle 0.35.0 https://github.com/drizzle-team/drizzle-orm/releases/tag/0.35.0 The pool/connection should now be passed as the `client` arg when initializing drizzle. ```ts this.drizzle = drizzle({ client: this.poolOptions ? new VercelPool(this.poolOptions) : sql, logger, schema: this.schema, }) ``` This was causing an issue where running `payload migrate` on Vercel was causing drizzle to attempt to `127.0.0.1:5432` instead of the specified environment variable in the adapter 🤔
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.