kysely-prisma-postgres
offers a Kysely dialect for Prisma Postgres (PPG), enabling type-safe SQL queries over HTTP.
npm install kysely-prisma-postgres @prisma/ppg kysely
pnpm add kysely-prisma-postgres @prisma/ppg kysely
yarn add kysely-prisma-postgres @prisma/ppg kysely
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();