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

fix(postgresql): Support renaming and dropping materialized views #3728

Conversation

swallowstalker
Copy link
Contributor

solving the issue here #3371

basically if there are create mv - rename mv - drop mv, then on drop mv statement, the sqlc generate will fail because mv involved in rename statement is not registered to the list of statements, in short make them invisible to drop mv operations.

before

$ sqlc-dev generate -f internal/endtoend/testdata/ddl_rename_drop_materialized_views/postgresql/pgx/v5/sqlc.yaml
# package querytest
schema.sql:1:1: relation "authors_mv_old" does not exist

after (no error)

$ sqlc-dev generate -f internal/endtoend/testdata/ddl_rename_drop_materialized_views/postgresql/pgx/v5/sqlc.yaml

@swallowstalker
Copy link
Contributor Author

hi @kyleconroy, as this is my first PR in this repo, let me know if i needed to add some additional testing for this (i'm unable to assign you as reviewer in this PR, maybe its maintainer only)

@kyleconroy kyleconroy changed the title fix: postgresql alter materialized view is not registered to statements fix(postgresql): Alter materialized view is not registered to statements Dec 2, 2024
@kyleconroy kyleconroy changed the title fix(postgresql): Alter materialized view is not registered to statements fix(postgresql): Support renaming and dropping materialized views Dec 2, 2024
@kyleconroy kyleconroy merged commit fc8723e into sqlc-dev:main Dec 2, 2024
8 checks passed
@kyleconroy
Copy link
Collaborator

Thanks for the excellent first pull request. For future changes, this is the correct amount of testing for a change like this.

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