[Introspection] Decide on a way forward for introspection of types our internal type system currently cannot represent
See original GitHub issueThe 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 the raw
API).
We currently introspect tsvector
columns as String
(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
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
[Introspection] Comment out all unsupported column types
[Introspection] Decide on a way forward for introspection of types our internal type system currently cannot represent #1690.
Read more >Why You Should Disable GraphQL Introspection In Production
In this post, we'll discuss why we believe you should disable GraphQL introspection in production, how to do it, and present a way...
Read more >Introspection - Stanford Encyclopedia of Philosophy
The temporal proximity condition: Introspection is a process that generates knowledge, beliefs, or judgments about one's currently ongoing ...
Read more >Introspection - Wikipedia
Introspection is the examination of one's own conscious thoughts and feelings. In psychology, the process of introspection relies on the observation of ...
Read more >Introspection: Definition, Uses, Examples, and Tips
One way to use introspection is for reflection, which involves consciously examining our internal psychological processes.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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).
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:
String
.