Skip to content

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 Dec 2, 2024
@kyleconroy kyleconroy changed the title fix(postgresql): Alter materialized view is not registered to statements 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.

alfonsodev pushed a commit to ExponentiaTeam/sqlc that referenced this pull request Oct 13, 2025
…ts (sqlc-dev#3728)

Co-authored-by: Pulung Ragil <pulung.ragil@wartek.belajar.id>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants