0.11.0 • Published 7 months ago

knex-pglite v0.11.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

knex-pglite

NPM Version CI

PGlite Dialect for knex.js

Since PGlite is single user and only supports a single connection, this library doesn't allow users to configure the connection pool in the Knex.Config. Internally, the pool is set to { min: 1, max: 1 }, i.e. there is exactly one connection at a time.

Install

npm install knex-pglite

Usage

import { knex } from "knex";
import ClientPgLite from "knex-pglite";

const instance = knex({
  client: ClientPgLite,
  dialect: "postgres",
  // Use an empty object to use an in memory db
  connection: {},
  // OR use the filesystem:
  // connection: { filename: 'path/to/my-pgdata' },
  // OR use indexdb:
  // connection: { connectionString: 'idb://my-pgdata' },
  // OR provide own PGLite instance (experimental; no TypeScript types...)
  // connection: { pglite: new PGLite() },
});

Acknowledgements

Mostly based on the build-in knex Postgres/Sqlite dialects.

License

MIT License

0.9.8

8 months ago

0.9.9

8 months ago

0.10.0

8 months ago

0.11.0

7 months ago

0.9.7

10 months ago

0.9.4

11 months ago

0.9.3

11 months ago

0.9.6

10 months ago

0.9.5

11 months ago

0.9.2

11 months ago

0.9.1

11 months ago

0.9.0

11 months ago