Skip to content

Commit

Permalink
Pg driver adapter schema (#5954)
Browse files Browse the repository at this point in the history
* add note about specifying the postgres schema with the driver adapter for pg

* add note about specifying the postgres schema with the driver adapter for neon
  • Loading branch information
nikolasburk authored Apr 26, 2024
1 parent db36978 commit 13732fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Notice that this code requires the `DATABASE_URL` environment variable to be set

#### Specifying a PostgreSQL schema

You can specify the https://www.postgresql.org/docs/current/ddl-schemas.html by passing in the `schema` option when instantiating `PrismaPg`:
You can specify a [PostgreSQL schema](https://www.postgresql.org/docs/current/ddl-schemas.html) by passing in the `schema` option when instantiating `PrismaPg`:

```ts
const adapter = new PrismaPg(pool, {
Expand Down
12 changes: 12 additions & 0 deletions content/200-orm/050-overview/500-databases/890-neon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,15 @@ const prisma = new PrismaClient({ adapter })
```

You can then use Prisma Client as you normally would with full type-safety. Prisma Migrate, introspection, and Prisma Studio will continue working as before, using the connection string defined in the Prisma schema.

### Notes

#### Specifying a PostgreSQL schema

You can specify a [PostgreSQL schema](https://www.postgresql.org/docs/current/ddl-schemas.html) by passing in the `schema` option when instantiating `PrismaNeon`:

```ts
const adapter = new PrismaNeon(pool, {
schema: 'myPostgresSchema'
})
```

0 comments on commit 13732fc

Please sign in to comment.