-
Notifications
You must be signed in to change notification settings - Fork 279
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
add returning
support in MERGE
queries.
#1171
Merged
igalklebanov
merged 2 commits into
kysely-org:v0.28
from
igalklebanov:pg-merge-returning
Dec 1, 2024
Merged
add returning
support in MERGE
queries.
#1171
igalklebanov
merged 2 commits into
kysely-org:v0.28
from
igalklebanov:pg-merge-returning
Dec 1, 2024
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
enhancement
New feature or request
postgres
Related to PostgreSQL
labels
Oct 7, 2024
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
igalklebanov
force-pushed
the
pg-merge-returning
branch
from
October 12, 2024 11:46
6c67c82
to
6f5bd45
Compare
igalklebanov
force-pushed
the
pg-merge-returning
branch
from
October 19, 2024 14:27
6f5bd45
to
15c3659
Compare
igalklebanov
force-pushed
the
v0.28
branch
2 times, most recently
from
October 24, 2024 12:39
b2b78db
to
ae5cb1e
Compare
igalklebanov
force-pushed
the
pg-merge-returning
branch
from
October 26, 2024 21:26
b247f1f
to
ce43779
Compare
igalklebanov
force-pushed
the
pg-merge-returning
branch
from
October 27, 2024 22:15
ce43779
to
01f3621
Compare
igalklebanov
force-pushed
the
pg-merge-returning
branch
from
October 27, 2024 22:17
01f3621
to
e8cff03
Compare
igalklebanov
force-pushed
the
pg-merge-returning
branch
from
November 4, 2024 23:06
e8cff03
to
6aedec0
Compare
igalklebanov
force-pushed
the
pg-merge-returning
branch
from
November 24, 2024 00:46
6aedec0
to
11ebc19
Compare
Open in Stackblitz • kysely_koa_example
commit: |
add returning compilation. add MultiTableReturningInterface. add returning/returningAll @ MergeQueryBuilder. add returning @ transformer. add returning handling @ execute. fix returningAll not allowing source table in single variant. remove multi table variant returningAll. add unit tests. allow overriding which expression builder is created in select parsers. support merge_action() unit tests. Discard changes to src/parser/expression-parser.ts Discard changes to src/parser/select-parser.ts extract `mergeAction` to helper instead. .. typings tests. fix returningAll() typeings test case. Discard changes to src/parser/merge-parser.ts
igalklebanov
force-pushed
the
pg-merge-returning
branch
from
December 1, 2024 08:03
11ebc19
to
c61be00
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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 👋
closes #1169.
As of PostgreSQL 17,
MERGE
queries now havereturning
clause support.returning
/returningAll
toMERGE
.MultiTableReturningInterface
, enforce it acrossDeleteQueryBuilder
,UpdateQueryBuilder
andMERGE
builders. Why? the existingReturningInterface
doesn't have thereturningAll(tables)
methods, andINSERT
queries are the only ones that don't supportreturning table.*
.merge_action()
in a type-safe and aliasable way - a PostgreSQL helper function was found to be the lightest solution. Expanding theExpressionBuilder
locally (only forreturning
) witheb.mergeAction()
was also tested, but was adding way more changes. I think that with documentation we could nullify the worse discoverability.