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

Support json_agg(column_ref) #1316

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SimonSimCity
Copy link

Fixes #1280.

Wow, my first PR in this repo 🤩

If there was something wrong about what I wrote - e.g. if the types are too narrow or wide, please let me know.

Here's what I know about this:

  • Postgresql returns an array if there are elements in the linked table.
  • Postgresql returns null otherwise.

According to the docs, this method does only exist for Postgresql, and I therefore didn't look into any other of the options.

Copy link

vercel bot commented Jan 9, 2025

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 Jan 9, 2025 5:20pm

Copy link

pkg-pr-new bot commented Jan 9, 2025

Open in Stackblitzkysely_koa_example

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

commit: 6be68bc

@SimonSimCity
Copy link
Author

Since it's likely that people will use this functionality with coalesce, I thought of adding a helper function, similar to the existing jsonArrayFrom. I don't know how you have it in regards to other dialects, because I would only be able to add it for Postgres. Here's an example of how this could be used: #1280 (comment)

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.

Support json_agg(column_ref).
1 participant