question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

postgresqlExtensions fails on generating the prisma client

See original GitHub issue

Bug 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

  1. Add previewFeatures = ["fullTextSearch", "postgresqlExtensions"] to your Prisma schema generator section
  2. Add extensions = [btree_gin, pg_trgm] to your Prisma schema
  3. Run prisma migrate dev
  4. 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:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
humblecodercommented, Dec 8, 2022

Best open a new issue @humblecoder - this sounds worth a dedicated look. The template will ask for the information we need.

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.

2reactions
vleanderssoncommented, Oct 24, 2022

@janpio @Jolg42 the package.json version is 4.5.0 but it looks like TypeGraphQLs prisma extension is enforcing 4.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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found