JSPM

@content-workers/postgres-adapter

1.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q68435F
  • License MIT

The official Postgres adapter for Lucid CMS

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-adapter

Setup

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.