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

add materialized view support #1509

Conversation

ludusrusso
Copy link
Contributor

@ludusrusso ludusrusso commented Mar 24, 2022

This PR Adds materialized view support.

Note that Materialized View are considered as CreateTableAs by github.com/pganalyze/pg_query_go/v2 so this adds also supporto to CREATE TABLE AS

Fix #1021

@kylecarbs it was a little bit hard to understand that CREATE MATERIALIZED VIEW are treated CREATE TABLE AS under the hood. It seems working, what do you think?

@ludusrusso ludusrusso force-pushed the add-materialized-view-and-create-table-as-support branch from af92724 to b3275c4 Compare March 24, 2022 16:54
@kylecarbs
Copy link
Contributor

@ludusrusso I believe you intended on tagging @kyleconroy!

@ludusrusso
Copy link
Contributor Author

😂😂 yep! Sorry!!

Copy link
Collaborator

@kyleconroy kyleconroy left a comment

Choose a reason for hiding this comment

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

Since this is implemented via CREATE TABLE AS, can we also add a test case for that statement?

internal/sql/catalog/table.go Outdated Show resolved Hide resolved
internal/sql/catalog/catalog.go Outdated Show resolved Hide resolved
internal/sql/ast/matview_stmt.go Outdated Show resolved Hide resolved
@ludusrusso ludusrusso force-pushed the add-materialized-view-and-create-table-as-support branch from b3275c4 to 07a8e96 Compare March 25, 2022 07:44
@ludusrusso
Copy link
Contributor Author

Since this is implemented via CREATE TABLE AS, can we also add a test case for that statement?

Fix your suggestions and add a new test case for create table as!
Thanks for help!

@malonehedges
Copy link

third party bump, looks like comments are addressed cc @kyleconroy

was trying to use materialized views today so happy to see this on the finish line 😄

@kyleconroy kyleconroy merged commit 367889d into sqlc-dev:main Mar 29, 2022
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.

Postgres materialized views problem
4 participants