Kysely dialect for PostgreSQL using the Postgres.js client library (version >= 3.4) or Bun's native SQL binding (Bun >= 1.2). This library is the official dialect maintained by the Kysely core team, offering a type-safe SQL query builder for PostgreSQL. Unlike Kysely's core pg dialect, this targets the modern Postgres.js and Bun runtimes. Current stable version is 3.0.0, released with frequent updates. Key differentiators: full TypeScript support, seamless integration with Kysely's type safety, and support for both Node.js and Bun.
npm install kysely-postgres-jsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Kysely instance with PostgresJSDialect, defines a simple schema, and selects all rows from the person table.
Update your runtime to Node >=20 or Bun >=1.2.
For Bun, import SQL from 'bun' instead of installing the 'postgres' npm package.
Pass the return value of postgres({...}) (a Postgres.js connection instance) as the 'postgres' option.Use ES module imports with 'import' or set 'type': 'module' in package.json.
Use import syntax: import { PostgresJSDialect } from 'kysely-postgres-js'Install kysely: npm install kysely
Install postgres: npm install postgres (version >=3.4)
Install kysely-postgres-js: npm install kysely-postgres-js