Skip to content

fix(snowflake): quote table names passed to GET_DDL - #884

Open
ikoma-cci wants to merge 1 commit into
k1LoW:mainfrom
ikoma-cci:fix/snowflake-quote-get-ddl
Open

ikoma-cci wants to merge 1 commit into
k1LoW:mainfrom
ikoma-cci:fix/snowflake-quote-get-ddl

Conversation

@ikoma-cci

@ikoma-cci ikoma-cci commented Oct 27, 2026 •

Copy link
Copy Markdown

Problem

The Snowflake driver passes the table name to GET_DDL without quotes.
Snowflake resolves unquoted identifiers in uppercase, so tbls doc fails on any table created with a lowercase or mixed-case quoted name.

A common case is the lowercase schema_migrations table created by golang-migrate.

Adding the table to exclude in .tbls.yml does not help, because the error occurs while the schema is being analyzed, before exclude is applied.

Fix

Quote the table name as a Snowflake identifier (escaping " as "") before passing it to GET_DDL.
Names returned by information_schema.tables keep their actual case, so the quoted name always matches the table that was listed.

Test

  • Added a unit test for the quoting helper.
  • Ran a patched build against a Snowflake schema that has a lowercase schema_migrations table. tbls doc completed without errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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