Skip to content

TypedSQL support type generation for PostGres json functions #27296

@destroyer22719

Description

@destroyer22719

Feature Summary

Currently if you use something like jsonb_build_object or jsonb_agg all it does is generate the $runtime.JsonValue type... which is pretty much useless and unclear, it just tells you what it can't be, not the type of what it is,

I was wondering if the Prisma team can upgrade support for postgres

Use Cases & Problem Description

Sometimes people want to write RAW SQL instead of using the Prisma Client, and a lot of the times that entails using functions lke jsonb_build_object and jsonb_agg to build more complex responses. But it currently can't properly generate types for it.

Proposed Solution

Generate the corresponding the corresponding types for Json values

Alternative Solutions

manually writing your own types

Potential Considerations

No response

Prisma Version

No response

What part of Prisma does this affect?

Prisma Client

Additional Context

I was looking into contributing to it... and it turns this one falls into the scope of the prisma engine... in which its repo is massive and took a surprisingly long time to install, and I don't know Rust.

So I was looking into contributing to the preview QueryCompiler, but query-compiler there is all in Rust even though I thought it was in TypeScript.

Pre-Submission Checklist

  • I have searched existing issues to make sure this is not a duplicate
  • I have checked the Prisma roadmap to see if this is already planned
  • I have described why this belongs in Prisma Core rather than a solution in application code

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureA request for a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions