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] Decide on a way forward for introspection of types our internal type system currently cannot represent #1690
Comments
Long term we definitely want to support all possible types. Supporting them we track under the name "native database types". But right now all types that can not be represented by one of the types we already support, or via a fallback to a string are problematic. That means that we have to find a guardrail for these types so user's can build applications with these types anyway. I agree that we should remove them from the models by commenting them out. This can become problematic if the columns are not nullable and there is no default value set on a database level. There might be dirty hacks to work around that in some way, but we do not really want to start getting into that. So tasks are:
|
In case we're indeed commenting out unsupported fields we should also disable write operations (in the Prisma Client) that could possibly fail (e.g. trying to create a new row with a required value missing). |
Interesting. |
For now we decided to implement the guardrail to comment all of these out in the schema: #1812 When this is done, we will check for sideffects and possibly implement workarounds for these. |
Guardrail is implemented and merged, ripple effects (including @schicklings's comment) are now tracked in #1912 🚀 |
The example of this problem we came across in https://github.com/prisma/prisma-client-js/issues/507 is postgres'
tsvector
. It is an opaque data structure that doesn't really make sense as a string and can only be constructed through postgres expressions, so it is not currently doable through prisma-client (outside of theraw
API).We currently introspect
tsvector
columns asString
(the fallback for types we do not handle yet), but prisma will fail to read or write to these columns. The problem is especially acute when we these columns are not nullable.The reasonable choice for now would probably be to ignore these columns when introspecting, and signal that we did that with a warning.
cc @janpio
The text was updated successfully, but these errors were encountered: