Dedicated adapter for Vercel Postgres - Uses the `@vercel/postgres` package under the hood. - No `pg` dependency, speeds up invocation - Includes refactoring all base postgres functionality into a `BasePostgresAdapter` type, which will ease implementation of [other adapters supported by drizzle-orm](https://orm.drizzle.team/docs/get-started-postgresql) ## Usage ```ts import { buildConfig } from 'payload' import { vercelPostgresAdapter } from '@payloadcms/db-vercel-postgres' export default buildConfig({ db: vercelPostgresAdapter({ pool: { connectionString: process.env.DATABASE_URI, }, }), // ...rest of config }) ``` ### Automatic Connection String Detection Have Vercel automatically detect from environment variable (typically `process.env.POSTGRES_URL`) ```ts export default buildConfig({ db: postgresAdapter(), // ...rest of config }) ```
39 lines
626 B
JSON
39 lines
626 B
JSON
{
|
|
"extends": "../../tsconfig.json",
|
|
"compilerOptions": {
|
|
"composite": true,
|
|
"noEmit": false,
|
|
"emitDeclarationOnly": true,
|
|
"outDir": "./dist",
|
|
"rootDir": "./src",
|
|
"skipLibCheck": true,
|
|
},
|
|
"exclude": [
|
|
"dist",
|
|
"build",
|
|
"tests",
|
|
"test",
|
|
"node_modules",
|
|
"eslint.config.js",
|
|
"src/**/*.spec.js",
|
|
"src/**/*.spec.jsx",
|
|
"src/**/*.spec.ts",
|
|
"src/**/*.spec.tsx"
|
|
],
|
|
"include": [
|
|
"src",
|
|
"src/**/*.ts",
|
|
],
|
|
"references": [
|
|
{
|
|
"path": "../payload"
|
|
},
|
|
{
|
|
"path": "../translations"
|
|
},
|
|
{
|
|
"path": "../drizzle"
|
|
}
|
|
]
|
|
}
|