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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introspection: Warn about database construct that PSL can not express #16311

Open
11 of 36 tasks
janpio opened this issue Nov 16, 2022 · 0 comments
Open
11 of 36 tasks

Introspection: Warn about database construct that PSL can not express #16311

janpio opened this issue Nov 16, 2022 · 0 comments
Labels
domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/epic A high-level initiative that has many subtasks. kind/feature A request for a new feature. topic: database-functionality topic: introspection topic: prisma db pull CLI: prisma db pull

Comments

@janpio
Copy link
Member

janpio commented Nov 16, 2022

When introspecting, Prisma currently only looks at the things it understands and can express via Prisma Schema Language in a Prisma Schema. When migrating the database later, the user has to ensure manually that all not understood features are added to migrations manually.

(Exceptions: Unsupported field types are introspected and expressed with Unsupported("...") and native database functions in defaults via dbgenerated("...") - and Migrations will use the raw string inside the function and use that in the generated SQL. Unsupported field types can then queried via Prisma's raw sql functions, and native database functions will be used by the database itself.)

Examples of constructs Prisma can currently not express in PSL, and hence skips during Introspection are:

Instead of just ignoring and skipping these, Prisma could detect them and output a warning after Introspection that this construct did not find its was into the Prisma Schema, and hence has to be handled manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/epic A high-level initiative that has many subtasks. kind/feature A request for a new feature. topic: database-functionality topic: introspection topic: prisma db pull CLI: prisma db pull
Projects
None yet
Development

No branches or pull requests

1 participant