Skip to content

kysely-org/kysely-prisma-postgres

Repository files navigation

A Kysely-branded yellow duck riding a Prisma Postgres branded grey elephant

NPM Version Tests License Issues Pull Requests GitHub contributors Downloads

Join the discussion ⠀⠀⠀⠀⠀⠀⠀

Discord Bluesky

kysely-prisma-postgres offers a Kysely dialect for Prisma Postgres (PPG), enabling type-safe SQL queries over HTTP.

Installation

npm install kysely-prisma-postgres @prisma/ppg kysely
pnpm add kysely-prisma-postgres @prisma/ppg kysely
yarn add kysely-prisma-postgres @prisma/ppg kysely

Usage

import { ppg } from "@prisma/ppg";
import { Kysely } from "kysely";
import { PPGDialect } from "kysely-prisma-postgres";

interface Database {
	person: {
		id: string;
		name: string;
	};
}

const db = new Kysely<Database>({
	dialect: new PPGDialect({
		ppg: ppg(process.env.PRISMA_POSTGRES_CONNECTION_STRING!),
	}),
});

const people = await db.selectFrom("person").selectAll().execute();

About

Prisma Postgres (PPG) dialect for Kysely

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •