Skip to content

Fix REFRESH statement type detection - #888

Open
kudala-bharani wants to merge 1 commit into
andialbrecht:masterfrom
kudala-bharani:fix/refresh-statement-type
Open

Fix REFRESH statement type detection#888
kudala-bharani wants to merge 1 commit into
andialbrecht:masterfrom
kudala-bharani:fix/refresh-statement-type

Conversation

@kudala-bharani

Copy link
Copy Markdown

REFRESH MATERIALIZED VIEW order_summary; currently returns UNKNOWN from Statement.get_type(), and lowercase refresh is not converted by keyword_case='upper'. Registering REFRESH as a DDL keyword fixes both behaviors. PostgreSQL includes materialized-view refreshes in its DDL event-trigger commands.

Closes #797.

  • Ran the tests: 512 passed, 2 xfailed, 1 xpassed on Python 3.12. The expected-failure markers are existing formatting/comment tests.
  • All style issues addressed: ruff check sqlparse/ passed.
  • Changes covered by six regression cases for statement detection and formatting; all six fail before the keyword is added.
  • Changelog updated.

Recognize REFRESH as a DDL keyword so materialized view refreshes report their statement type and honor keyword formatting. Cover supported query variants and leading comments with regressions for issue797.
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.

Support detection of REFRESH queries

1 participant