kysely-prisma-postgres
Version:
Prisma Postgres (PPG) dialect for Kysely
54 lines (40 loc) • 2.39 kB
Markdown

[](https://github.com/kysely-org/kysely-prisma-postgres/releases/latest)
[](https://github.com/kysely-org/kysely-prisma-postgres)
[](https://github.com/kysely-org/kysely-prisma-postgres/blob/master/LICENSE)
[](https://github.com/kysely-org/kysely-prisma-postgres/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
[](https://github.com/kysely-org/kysely-prisma-postgres/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc)

[](https://www.npmjs.com/package/kysely-prisma-postgres)
###### Join the discussion ⠀⠀⠀⠀⠀⠀⠀
[](https://discord.gg/xyBJ3GwvAm)
[](https://bsky.app/profile/kysely.dev)
`kysely-prisma-postgres` offers a [Kysely](https://kysely.dev/) dialect for [Prisma Postgres (PPG)](https://www.prisma.io/postgres), enabling type-safe SQL queries over HTTP.
## Installation
```bash
npm install kysely-prisma-postgres @prisma/ppg kysely
```
```bash
pnpm add kysely-prisma-postgres @prisma/ppg kysely
```
```bash
yarn add kysely-prisma-postgres @prisma/ppg kysely
```
## Usage
```ts
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();
```