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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview feature feedback: PostgreSQL extensions #15835

Open
floelhoeffel opened this issue Oct 17, 2022 · 5 comments
Open

Preview feature feedback: PostgreSQL extensions #15835

floelhoeffel opened this issue Oct 17, 2022 · 5 comments
Labels
kind/feedback Issue for gathering feedback. team/schema Issue for team Schema. topic: postgresqlExtensions topic: previewFeatures Issue touches on an preview feature flag

Comments

@floelhoeffel
Copy link

floelhoeffel commented Oct 17, 2022

Please use this issue to share any feedback about the postgresqlExtensions functionality released in v4.5.0.

Documentation can be found here.

If you encounter a bug, please open a bug report in this repo.

Many thanks 馃憦馃徎 from the Prisma team.

@chriskuech
Copy link

Please add support for cube

@Jolg42
Copy link
Member

Jolg42 commented Jan 22, 2024

@chriskuech The purpose of the postgresqlExtensions preview feature is to make it easy to manage PostgreSQL extensions with Prisma ORM.
So this is not about supporting the extensions, with for example a query API in Prisma Client (that would be best to ask in a new feature request).

What you can do is to add cube like this:

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["postgresqlExtensions"]
}

datasource db {
  provider   = "postgresql"
  url        = env("DATABASE_URL")
  extensions = [cube]
}

And then use Raw database access with Prisma Client.

Notes about cube
https://www.postgresql.org/docs/current/cube.html
https://www.timescale.com/learn/postgresql-extensions-cube

@chriskuech
Copy link

@Jolg42 Thanks. Doesn't that mean you need to add cube to the "allowlist" here?:
image

https://www.prisma.io/docs/orm/prisma-schema/postgresql-extensions

@Jolg42
Copy link
Member

Jolg42 commented Jan 30, 2024

@chriskuech So maybe this is confusing because it's more of a "well known list", what happens is that if an extension is on this list then the Introspection behavior changes, see below:
Screenshot 2024-01-30 at 10 54 25

Any extension can be used actually, the only difference will be in the behavior of Introspection / Re-Introspection.

I think I remember something about some extensions being safe to add or remove during migrations, but that's not guaranteed for any extension, so to be on the safe side we have this list. If an extension is not on this list, then you have to manually add it to the Prisma schema.

@foxfriends
Copy link

I have an extension installed for development purposes only (specifically: pgtap is manually installed on my local instance for testing, but intentionally not installed on my deployed database).

Currently, each time I try to migrate after installing pgtap to my local database and running my tests, Prisma tries to reset. This happens whether I have pgtap listed in my schema or not, because it detects pgtap being installed but not having been created by any migration.

Seeing as this extension will have no affect on Prisma or my application, whether installed or not, it would be useful for to be a way to mark an extension as "optional" or "development only" or "ignored" or something, so that it just... doesn't get involved at any time. Similar to the existing @ignore directive for fields/tables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feedback Issue for gathering feedback. team/schema Issue for team Schema. topic: postgresqlExtensions topic: previewFeatures Issue touches on an preview feature flag
Projects
None yet
Development

No branches or pull requests

5 participants