-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: type-safe JSON insertions/updates, eb.valJson
& sql.valJson
.
#1130
Draft
igalklebanov
wants to merge
18
commits into
kysely-org:v0.28
Choose a base branch
from
igalklebanov:stricter-json
base: v0.28
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
igalklebanov
added
api
Related to library's API
breaking change
Includes breaking changes
enhancement
New feature or request
labels
Aug 25, 2024
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
igalklebanov
changed the title
feat:
feat: Aug 25, 2024
Serialized<O>
, stricter JSONColumnType<O>
, eb.valSerialized
& sql.valSerialized
.Serialized<O>
, stricter JSONColumnType<O>
insertions/updates, eb.valSerialized
& sql.valSerialized
.
igalklebanov
changed the title
feat:
feat: stricter Aug 25, 2024
Serialized<O>
, stricter JSONColumnType<O>
insertions/updates, eb.valSerialized
& sql.valSerialized
.JSONColumnType<O>
insertions/updates, eb.valSerialized
& sql.valSerialized
.
igalklebanov
changed the title
feat: stricter
feat: type-safe Aug 25, 2024
JSONColumnType<O>
insertions/updates, eb.valSerialized
& sql.valSerialized
.JSONColumnType<O>
insertions/updates, eb.valSerialized
& sql.valSerialized
.
igalklebanov
changed the title
feat: type-safe
feat: type-safe Sep 1, 2024
JSONColumnType<O>
insertions/updates, eb.valSerialized
& sql.valSerialized
.JSONColumnType<O>
insertions/updates, eb.valJson
& sql.valJson
.
igalklebanov
changed the title
feat: type-safe
feat: type-safe JSON insertions/updates, Sep 3, 2024
JSONColumnType<O>
insertions/updates, eb.valJson
& sql.valJson
.eb.valJson
& sql.valJson
.
…kysely-org#1085) * add reusable helpers recipe and implement missing expression features * force node 22.4.1 in CI because of an npm bug
* feat: add postgres range types (kysely-org#1086) * feat: support refresh naterialized view * fix tests by adding .materialized() to remove the matview * fix failing test * fix: References typo (kysely-org#1092) * chore: refresh-view-node.ts => refresh-materialized-view-node.ts * chore: export node in index.ts --------- Co-authored-by: Isak <[email protected]> Co-authored-by: Jonathan Wu <[email protected]>
igalklebanov
force-pushed
the
stricter-json
branch
from
October 3, 2024 23:27
8e3dbf7
to
a7abe0f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey 👋
This PR deprecates
JSONColumnType
, and introduces the stricterJson
type that enforces type-safe insertions/updates.Using a branded type as the
InsertType
andUpdateType
AND as the return value of new serialization helpers inExpressionBuilder
andsql
template tag, users can now insert/update and serialize their JSON objects/arrays safely into JSON columns.Compilers/plugins can serialize the objects/arrays differently, as the value is passed around in a
ValueNode
with aserialized
flag. The default serialization method is, well,JSON.stringify
.If you want the non-type-safe old
JSONColumnType
.. we don't encourage it, but you can continue usingJSONColumnType
(until we decide to remove it) or just use:For a readonly
Json
, use: