kysely-org / kysely

A type-safe typescript SQL query builder
https://kysely.dev
MIT License
10.47k stars 267 forks source link

add `objectStrategy` option that allows to not mutate result objects/arrays @ `ParseJSONResultsPlugin`. #953

Closed igalklebanov closed 5 months ago

igalklebanov commented 5 months ago

Hey :wave:

This PR offers a way to avoid nasty runtime errors when result objects/arrays have non-writable props when parsing using ParseJSONResultsPlugin.

The default strategy is 'in-place' (similar to how the plugin behaves in latest version).

In large objects/arrays, the new create strategy might significantly differ in memory consumption, as it fills new objects/arrays instead of mutating the existing ones.

vercel[bot] commented 5 months ago

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 Apr 20, 2024 6:23pm