Skip to content

new branch#4

Merged
Veeresh-Hanni merged 2 commits into
mainfrom
v0.1.1
Mar 22, 2026
Merged

new branch#4
Veeresh-Hanni merged 2 commits into
mainfrom
v0.1.1

Conversation

@Veeresh-Hanni
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58cd707aa2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +802 to +805
if replace:
self.drop_view(view_name, if_exists=True)
sql = f"CREATE VIEW {self._quote(view_name)} AS {select_sql}" # nosec B608
return self.run_native(sql)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Make replace=True atomic before dropping the old object

When replace=True, this path calls drop_view() and then issues CREATE VIEW as two separate run_native() calls. Outside an explicit db.transaction(), run_native() opens its own engine.begin() block per call, so an invalid replacement query (or a missing referenced table) will commit the drop and then fail the create, leaving the previously working view gone. The same destructive pattern is repeated in the procedure/function/event helpers below.

Useful? React with 👍 / 👎.

Comment on lines +807 to +810
def drop_view(self, name: str, *, if_exists: bool = True) -> Any:
view_name = self._validate_identifier(name)
sql = f"DROP VIEW {'IF EXISTS ' if if_exists else ''}{self._quote(view_name)}" # nosec B608
return self.run_native(sql)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Invalidate cached schema after creating or dropping a view

find()/count() reuse reflected metadata from _table_cache and _column_type_cache, but neither create_view() nor drop_view() clears those caches. If a view has been queried once and is then recreated with a different projection via replace=True, subsequent reads on the same UDOM instance will keep using the stale column set from the old view, which can silently omit new columns or raise on removed ones.

Useful? React with 👍 / 👎.

@Veeresh-Hanni Veeresh-Hanni merged commit 5c8de1a into main Mar 22, 2026
4 checks passed
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.

1 participant