Package Exports
- @content-workers/postgres-adapter
Readme
Lucid CMS - Postgres Adapter
The official Postgres adapter for Lucid CMS
The Lucid CMS Postgres adapter allows you to use PostgreSQL as your database. This registers a postgres dialect for Kysely under the hood and makes use of the Postgres library.
Installation
npm install @lucidcms/postgres-adapterSetup
To use the Postgres adapter, you need to add it to your Lucid CMS config file. You'll need to provide a PostgreSQL connection URL at a minimum.
import { nodeAdapter, defineConfig } from "@lucidcms/node-adapter";
import PostgresAdapter from "@lucidcms/postgres-adapter";
export const adapter = nodeAdapter();
export default defineConfig((env) => ({
db: new PostgresAdapter(env.DATABASE_URL),
// ...other config
}));Configuration
The adapter accepts two parameters: the first is the connection string, and the second is an optional options object. This uses the Postgres library under the hood, so please refer to their documentation on the available options.