Open gausie opened 3 days ago
Hi @gausie, thanks for opening this feature request, would you like to work on it? remember to add unit tests...
I'm not even sure how is the plugin system working for TypedSQL...
Yeah nor do I. I will gladly give it a go though
Had a little look into doing it - generating types with --sql
relies on introspection via the schema engine, so it doesn't fit well into the current approach to testing. We could look at using something like pgmock
to provide a valid url for the db provider... but that's a big change. What do you think?
I think it will be easier to just spin up a docker postgres via docker compose and test using that db/schema.
How would you want to do that in CI?
Fair enough!
Prerequisites
Versions
Prisma 5.20.0 prisma-json-types-generator 3.1.1
Description
A query written with Prisma's new TypedSQL returns
JsonValue
as normal for a column that has been typed with this package.Steps to Reproduce
Write a TypedSQL query that returns a Json field. Observe that it is typed as
JsonValue
Expected Behavior
It should be typed according to the triple slash comment in schema.prisma