From d61e191e87e5c32f6e64b59d37d50230e2920f91 Mon Sep 17 00:00:00 2001 From: Nikolas Burk Date: Fri, 26 Apr 2024 15:41:41 +0200 Subject: [PATCH 1/2] add note about specifying the postgres schema with the driver adapter for pg --- .../050-overview/500-databases/300-postgresql.mdx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/content/200-orm/050-overview/500-databases/300-postgresql.mdx b/content/200-orm/050-overview/500-databases/300-postgresql.mdx index 6e4f29a9a1..a36635f19e 100644 --- a/content/200-orm/050-overview/500-databases/300-postgresql.mdx +++ b/content/200-orm/050-overview/500-databases/300-postgresql.mdx @@ -87,6 +87,18 @@ const prisma = new PrismaClient({ adapter }) Notice that this code requires the `DATABASE_URL` environment variable to be set to your PostgreSQL connection string. You can learn more about the connection string below. +### Notes + +#### 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`: + +```ts +const adapter = new PrismaPg(pool, { + schema: 'myPostgresSchema' +}) +``` + ## Connection details ### Connection URL From bc2561e36056d3d99a404b75b418d9f0d5c1ed3a Mon Sep 17 00:00:00 2001 From: Nikolas Burk Date: Fri, 26 Apr 2024 15:46:52 +0200 Subject: [PATCH 2/2] add note about specifying the postgres schema with the driver adapter for neon --- .../050-overview/500-databases/300-postgresql.mdx | 2 +- .../200-orm/050-overview/500-databases/890-neon.mdx | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/content/200-orm/050-overview/500-databases/300-postgresql.mdx b/content/200-orm/050-overview/500-databases/300-postgresql.mdx index a36635f19e..340f10e026 100644 --- a/content/200-orm/050-overview/500-databases/300-postgresql.mdx +++ b/content/200-orm/050-overview/500-databases/300-postgresql.mdx @@ -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, { diff --git a/content/200-orm/050-overview/500-databases/890-neon.mdx b/content/200-orm/050-overview/500-databases/890-neon.mdx index 7aa8189a17..608dc21174 100644 --- a/content/200-orm/050-overview/500-databases/890-neon.mdx +++ b/content/200-orm/050-overview/500-databases/890-neon.mdx @@ -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' +}) +```