Skip to content

feat: adds merge into upsert statements - #182

Merged
matthias-Q merged 2 commits into
DerekStride:mainfrom
matthias-Q:merge_into_statement
Jul 14, 2023
Merged

feat: adds merge into upsert statements#182
matthias-Q merged 2 commits into
DerekStride:mainfrom
matthias-Q:merge_into_statement

Conversation

@matthias-Q

@matthias-Q matthias-Q commented Jul 14, 2023

Copy link
Copy Markdown
Collaborator

This PR add the MERGE INTO statement used by Trino/Athena/Snowflake/Iceberg

Reference:
https://trino.io/docs/current/sql/merge.html
https://docs.snowflake.com/en/sql-reference/sql/merge
https://docs.aws.amazon.com/athena/latest/ug/merge-into-statement.html

Note:
I also added the "keyword_check" bash script to the test command, so that we check it during development and not just during CI

I think T-SQL and Oracle also support this statement. On a quick glance, Oracle should be covered, T-SQL has some extra commands.

[Update]: I just realized that Postgres also supports this 😲 It also is almost fully covered! https://www.postgresql.org/docs/current/sql-merge.html

@matthias-Q
matthias-Q force-pushed the merge_into_statement branch from 732efb4 to 10aa8c0 Compare July 14, 2023 06:03
@matthias-Q
matthias-Q force-pushed the merge_into_statement branch from 10aa8c0 to 61760bb Compare July 14, 2023 06:04
@matthias-Q
matthias-Q requested review from DerekStride and dmfay July 14, 2023 06:04

@dmfay dmfay left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

couple little bookkeeping issues but lgtm!

Comment thread grammar.js Outdated
Comment thread test/corpus/insert.txt Outdated
Comment thread grammar.js Outdated
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.

2 participants