kysely icon indicating copy to clipboard operation
kysely copied to clipboard

fix(helpers): JSON helpers' return types incorrectly have `Date`s and other JS/Node-native instances that require data type metadata.

Open igalklebanov opened this issue 6 months ago • 2 comments

Hey :wave:

closes #482.

We're going for a shallow approach - no recursion:

  1. Recursion would be very expensive at compile time.

  2. JSON results of nested JSON helpers should already be covered by their return type calculation.

  3. If you have JSON columns, you should have already defined them properly - no JS/Node native, JSON invalid, types in their SelectType.

  4. PostgreSQL arrays are in the scope of this change. e.g. a timestamp[] column would be string[], not Date[].

Typings test seems to be running for same amount of time. 😬

Will add some more cases tomorrow.

igalklebanov avatar Jun 02 '25 14:06 igalklebanov

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kysely ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 18, 2025 0:07am

vercel[bot] avatar Jun 02 '25 14:06 vercel[bot]

kysely_koa_example

npm i https://pkg.pr.new/kysely-org/kysely@1477

commit: 151490b

pkg-pr-new[bot] avatar Jun 02 '25 14:06 pkg-pr-new[bot]