Connectors

PostgreSQL

Connect DB0 to PostgreSQL


Read more in www.postgresql.org.

Usage

For this connector, you need to install pg dependency:

npm i pg @types/pg

Use postgresql connector:

import { createDatabase, sql } from "db0";
import postgresql from "db0/connectors/postgresql";

const db = createDatabase(
  postgresql({
    bindingName: "DB",
  }),
);

Options

url

Connection URL string.

Alternatively, you can add connection configuration.

Read more in node-postgres client options.