Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(database-drivers): PGlite #6068

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ toc_max_heading_level: 4

## Default built-in drivers

One of Prisma Client's components is the [Query Engine](/orm/more/under-the-hood/engines). The Query Engine is responsible for transforming Prisma Client queries to SQL statements. The Query Engine connects to your database via TCP using built-in drivers that don't require additional setup.
One of Prisma Client's components is the [Query Engine](/orm/more/under-the-hood/engines). The Query Engine is responsible for transforming Prisma Client queries into SQL statements. It connects to your database via TCP using built-in drivers that don't require additional setup.

![Query flow from the user application to the database with Prisma Client](./images/drivers/qe-query-execution-flow.png)

Expand Down Expand Up @@ -46,15 +46,16 @@ Prisma ORM maintains the following serverless driver adapters:

### Community-maintained database driver adapters

You can also build your own driver adapter for the database you're using. The following is a list of community maintained driver adapters:
You can also build your own driver adapter for the database you're using. The following is a list of community-maintained driver adapters:

- [TiDB](https://github.com/tidbcloud/prisma-adapter)
- [TiDB Cloud Serverless Driver](https://github.com/tidbcloud/prisma-adapter)
- [PGlite - Postgres in WASM](https://github.com/lucasthevenet/pglite-utils/tree/main/packages/prisma-adapter)

## How to use driver adapters

To use this feature:

1. Update the `previewFeatures` block in your schema to include the the `driverAdapters` Preview feature:
1. Update the `previewFeatures` block in your schema to include the `driverAdapters` Preview feature:

```prisma
generator client {
Expand All @@ -69,7 +70,7 @@ To use this feature:
npx prisma generate
```

3. Refer to the following pages to learn more how to use the specific driver adapters with the specific database providers:
3. Refer to the following pages to learn more about how to use the specific driver adapters with the specific database providers:

- [PostgreSQL](/orm/overview/databases/postgresql#using-the-node-postgres-driver)
- [Neon](/orm/overview/databases/neon#how-to-use-neons-serverless-driver-with-prisma-orm-preview)
Expand Down Expand Up @@ -149,7 +150,7 @@ yarn add db@link:./src/generated/client

</TabbedContent>

Now you should be able to reference your generated client using `db`!
Now, you should be able to reference your generated client using `db`!

```ts
import { PrismaClient } from 'db'
Expand Down
Loading