Skip to content
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: add jsonb (fixes #317) #333

Merged
merged 4 commits into from Mar 27, 2022
Merged

feat: add jsonb (fixes #317) #333

merged 4 commits into from Mar 27, 2022

Conversation

gajus
Copy link
Owner

@gajus gajus commented Mar 26, 2022

  • changes sql.json to produce bindings with ::json type identifier
  • adds new sql.jsonb method
  • sql.json is now 'null':json (previously it was NULL)

If you desire the old sql.json NULL behavior, you will need to refactor code to:

const foo = /* maybe NULL */;

sql`
SELECT ${foo === null ? NULL : sql.json(foo)}
`

BREAKING CHANGE:

  • previously sql.json did not specify ::json or ::jsonb. Now the appropriate type identifier is chosen based on whether you use sql.json or sql.jsonb. In future, this may be leveraged to achieve greater performance when using sql.jsonb.

BREAKING CHANGE:
* previously sql.json did not specify ::json or ::jsonb. Now the appropriate type identifier is chosen based on whether you use ::json or ::jsonb
@coveralls
Copy link

coveralls commented Mar 26, 2022

Coverage Status

Coverage increased (+0.05%) to 88.835% when pulling 7e56c94 on gajus/add-jsonb into 2249e05 on master.

BREAKING CHANGE:
* previously sql.json did not specify ::json or ::jsonb. Now the appropriate type identifier is chosen based on whether you use ::json or ::jsonb
@gajus gajus changed the title feat: add jsonb feat: add jsonb (fixes #317) Mar 26, 2022
.README/QUERY_BUILDING.md Outdated Show resolved Hide resolved
Copy link
Contributor

@thecodeboss thecodeboss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks solid to me, thanks for tackling this. Tests look great too.

@gajus gajus merged commit 476a856 into master Mar 27, 2022
@gajus
Copy link
Owner Author

gajus commented Mar 27, 2022

🎉 This PR is included in version 28.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants