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 UNION query (Postgres + MySQL) #896

Merged
merged 4 commits into from
Feb 28, 2021

Conversation

aitva
Copy link
Contributor

@aitva aitva commented Feb 14, 2021

Hi,

This is a follow up on #790, I have implemented UNION support for MySQL. This pull request contains changes to the compiler, new test cases, and changes to engine/dolphin. I cleaned up the commit history to fit the changes in 3 commits.

If it is OK, we can close #790 and replace it by this pull request. It should fix #568, #709, #723 and #843.

This commit adds support for UNION query in the compiler. It adds test cases
for UNION in a SELECT and in a recursive CTE.
This commit adds enum values for SetOperation. The values are extracted from
the parser sources in pg_query_go:

typedef enum SetOperation
{
    SETOP_NONE = 0,
    SETOP_UNION,
    SETOP_INTERSECT,
    SETOP_EXCEPT
} SetOperation;
@aitva
Copy link
Contributor Author

aitva commented Feb 24, 2021

I noticed #867 and I have added unit tests to ensure that INTERSECT and EXCEPT are working.

@kyleconroy kyleconroy merged commit 4e04f32 into sqlc-dev:master Feb 28, 2021
@kyleconroy
Copy link
Collaborator

@aitva Thanks for the great contribution! Really appreciate all the tests you've added

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.

Union support for Postgres
2 participants