postgresqlExtensions fails on generating the prisma client
See original GitHub issueBug description
When adding the new postgresqlExtensions
and extensions = [btree_gin, pg_trgm]
to the prisma schema, the migration works fine (prisma migrate dev
) but the client generation fails afterward.
Error:
Schema validation error - Error (query-engine-node-api library)
Error code: P1012
error: The preview feature "postgresqlExtensions" is not known. Expected one of: referentialIntegrity, interactiveTransactions, fullTextSearch, fullTextIndex, tracing, metrics, orderByN
ulls, filteredRelationCount, fieldReference
--> schema.prisma:3
|
2 | provider = "prisma-client-js"
3 | previewFeatures = ["fullTextSearch", "postgresqlExtensions"]
|
error: Property not known: "extensions".
--> schema.prisma:10
|
9 | url = env("DATABASE_URL")
10 | extensions = [btree_gin, pg_trgm]
11 | }
|
Validation Error Count: 2
How to reproduce
- Add
previewFeatures = ["fullTextSearch", "postgresqlExtensions"]
to your Prisma schema generator section - Add
extensions = [btree_gin, pg_trgm]
to your Prisma schema - Run
prisma migrate dev
- The DB migration will pass, and then try to run generation of the Prisma Client - this fails
Expected behavior
Prisma v. 4.5.0 are able to generate the client with extensions and postgresqlExtensions
preview feature
Prisma information
generator client {
provider = "prisma-client-js"
previewFeatures = ["fullTextSearch", "postgresqlExtensions"]
binaryTargets = ["native", "rhel-openssl-1.0.x"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
extensions = [btree_gin, pg_trgm]
}
Environment & setup
- OS: macOS
- Database: PostgreSQL
- Node.js version: v16.15.0
Prisma Version
prisma : 4.5.0
@prisma/client : 4.5.0
Current platform : darwin-arm64
Query Engine (Node-API) : libquery-engine 0362da9eebca54d94c8ef5edd3b2e90af99ba452 (at ../../../node_modules/prisma/node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Migration Engine : migration-engine-cli 0362da9eebca54d94c8ef5edd3b2e90af99ba452 (at ../../../node_modules/prisma/node_modules/@prisma/engines/migration-engine-darwin-arm64)
Introspection Engine : introspection-core 0362da9eebca54d94c8ef5edd3b2e90af99ba452 (at ../../../node_modules/prisma/node_modules/@prisma/engines/introspection-engine-darwin-arm64)
Format Binary : prisma-fmt 0362da9eebca54d94c8ef5edd3b2e90af99ba452 (at ../../../node_modules/prisma/node_modules/@prisma/engines/prisma-fmt-darwin-arm64)
Format Wasm : @prisma/prisma-fmt-wasm 4.5.0-43.0362da9eebca54d94c8ef5edd3b2e90af99ba452
Default Engines Hash : 0362da9eebca54d94c8ef5edd3b2e90af99ba452
Studio : 0.476.0
Preview Features : fullTextSearch, postgresqlExtensions
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to represent PostgreSQL extensions in your ... - Prisma
How to represent PostgreSQL extensions in your Prisma scheme, introspect extensions in your database, and apply changes to extensions with Prisma Migrate.
Read more >db error: ERROR: type "citext" does not exist" but ... - GitHub
Create a DB via psql and run CREATE EXTENSION citext; on the DB. · Ensure your prisma folder has no migrations folder (so...
Read more >Prisma Schema not updating properly after adding new fields
I think the extension struggles to update itself with the new changes. ... Open file node_modules\.prisma\client\index.d.ts to get VS Code ...
Read more >Prisma - Supabase
This guide explains how to quickly connect the Postgres database provided by Supabase to a Prisma project. Prisma is an open source next-generation...
Read more >Creating a PostgreSQL DB instance and connecting to a ...
The easiest way to create a DB instance is to use the AWS Management Console. After you have created the DB instance, you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Apologies, and correction. This seems to only happen with the
postGIS
extension. If I remove it and leave the others in place everything works correctly. I’ll do a deeper dive before I post a new issue.Thanks.
@janpio @Jolg42 the package.json version is
4.5.0
but it looks like TypeGraphQLs prisma extension is enforcing4.4.0
so I am gonna assume this is the issue.It is indeed a monorepo, yarn berry.
Closing this issue as it looks like it is related to external packages. Thanks for the help!