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 kyselypnpm add kysely-prisma-postgres @prisma/ppg kyselyyarn add kysely-prisma-postgres @prisma/ppg kyselyimport { 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();