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: adds merge into upsert statements #182

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

matthias-Q
Copy link
Collaborator

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

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
Copy link
Collaborator

@dmfay dmfay left a comment

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!

grammar.js Outdated Show resolved Hide resolved
test/corpus/insert.txt Outdated Show resolved Hide resolved
grammar.js Outdated Show resolved Hide resolved
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