You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library will assume this is a relation and the requests will fail.
My proposed solution would be to either infer that this is not a relation using the prisma schema, or to access an array of keys in PrismaService that will pass through those keys exactly as given in the PATCH request.
@kepelrs let me know which method you'd prefer and I'll open a PR.
The text was updated successfully, but these errors were encountered:
Yes, that is expected as described in the limitations. I'd hope by now Prisma would have some sort of API that lets us check/traverse a model's relations at run time. But I have yet to find time to look into it.
To answer the question, I'd lean towards the second option. The first approach is cleaner, but it is larger and trickier work.
I believe this work would essentially enable JSON database support, so the new PrismaCrudService property would probably need to be something along the lines of jsonProperties: string[] | 'all', where we'd pass jsonProperties = ['myJsonProp'] when we have a relational database with some json fields, and we'd use jsonProperties = 'all' when our db is something like MongoDB.
For a model with a column that's an array:
This library will assume this is a relation and the requests will fail.
My proposed solution would be to either infer that this is not a relation using the prisma schema, or to access an array of keys in PrismaService that will pass through those keys exactly as given in the PATCH request.
@kepelrs let me know which method you'd prefer and I'll open a PR.
The text was updated successfully, but these errors were encountered: