Introspection: Warn about database construct that PSL can not express #16311
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
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 viadbgenerated("...")
- 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:
INCLUDE
clauseNULL
behaviorbtree_gin
based indexesDOMAIN
IDENTITY
columns in PostgreSQL$jsonSchema
for MongoDBSTRICT
tablesInstead 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.
The text was updated successfully, but these errors were encountered: