Skip to content

fix(catalog): harden DDL table name extraction#30

Merged
lostmygithubaccount merged 1 commit into
mainfrom
cody/improve-ddl-name-extraction
Apr 6, 2026
Merged

fix(catalog): harden DDL table name extraction#30
lostmygithubaccount merged 1 commit into
mainfrom
cody/improve-ddl-name-extraction

Conversation

@lostmygithubaccount
Copy link
Copy Markdown
Member

Summary

  • Rewrote extract_ddl_table_name to work on original-case SQL instead of uppercased input, doing case-insensitive keyword matching while preserving the table name's original case
  • Added support for quoted identifiers containing spaces (e.g., "my table") by parsing quote-delimited segments instead of naive whitespace splitting
  • Added support for schema-qualified names (myschema.mytable → extracts mytable)
  • Added 17 unit tests covering: simple DDL, IF NOT EXISTS/IF EXISTS, TEMP tables, quoted names (double quotes, backticks), quoted names with spaces, schema-qualified names, case-insensitive keywords, leading whitespace, semicolons, empty/invalid input

Fallback to full refresh remains unchanged — correctness here is an optimization.

🤖 Generated with Claude Code

…lified names

The function now works on original-case SQL (not uppercased), handles
quoted identifiers containing spaces, and extracts the table segment
from schema-qualified names (schema.table → table). Adds 17 unit tests
covering edge cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lostmygithubaccount lostmygithubaccount enabled auto-merge (squash) April 6, 2026 04:42
@lostmygithubaccount lostmygithubaccount merged commit 3e884b7 into main Apr 6, 2026
1 check passed
@lostmygithubaccount lostmygithubaccount deleted the cody/improve-ddl-name-extraction branch April 6, 2026 04:52
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