kysely
kysely copied to clipboard
add `returning` support in `MERGE` queries.
Hey 👋
closes #1169.
As of PostgreSQL 17, MERGE queries now have returning clause support.
- [x] add
returning/returningAlltoMERGE. - [x] add
MultiTableReturningInterface, enforce it acrossDeleteQueryBuilder,UpdateQueryBuilderandMERGEbuilders. Why? the existingReturningInterfacedoesn't have thereturningAll(tables)methods, andINSERTqueries are the only ones that don't supportreturning table.*. - [x] add a way to return
merge_action()in a type-safe and aliasable way - a PostgreSQL helper function was found to be the lightest solution. Expanding theExpressionBuilderlocally (only forreturning) witheb.mergeAction()was also tested, but was adding way more changes. I think that with documentation we could nullify the worse discoverability. - [x] unit tests.
- [x] typings tests.
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 | Dec 1, 2024 2:20pm |
Open in Stackblitz • kysely_koa_example
npm i https://pkg.pr.new/kysely-org/kysely@1171
commit: c0dc22f