Skip to content

fix(snowflake): preserve view definitions - #2822

Open
HandSonic wants to merge 2 commits into
OtterMind:mainfrom
HandSonic:fix/snowflake-view-definition
Open

HandSonic wants to merge 2 commits into
OtterMind:mainfrom
HandSonic:fix/snowflake-view-definition

Conversation

@HandSonic

@HandSonic HandSonic commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

N/A - no matching issue was found.

Summary

Snowflake INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION already contains the view query definition. The previous implementation searched that value for a lowercase as and returned a substring, which truncated uppercase/no-AS definitions, returned only the suffix after lowercase aliases, and threw for null definitions. This change preserves the JDBC definition verbatim while retaining the existing view identity and empty-result behavior.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Commands and results:
    • Focused SnowflakeMetaDataTest: 5 tests passed, 0 failures/errors/skips.
    • Snowflake module tests after rebase: 40 passed; all 9 reactor modules succeeded.
    • git diff --check: passed.
    • Fork PR Feat: jdbc paging and transactions, can be used as a reference. #80 code checks: Frontend, Backend, JavaScript/Java CodeQL, repository/docs, SBOM, and frontend license succeeded on 5ca0306a45273899c4dad41396b29f4367004176.
    • Latest-main revalidation: focused 5/5 and full Snowflake module 40/40 passed; 45/45 pairwise merge simulations passed.
  • Manual verification: N/A - JDBC proxy tests cover uppercase AS, lowercase aliases, no AS, null definitions, and empty result sets.
  • UI evidence: N/A

Risk and compatibility

  • Public API or stored data: No API or storage-format changes.
  • Database or driver compatibility: Snowflake view definitions now follow the JDBC VIEW_DEFINITION contract without parsing or rewriting the returned SQL.
  • Network, privacy, or security: N/A.
  • Community / Local / Pro boundary: Shared Community Snowflake plugin behavior.
  • Backward compatibility: Existing view identity fields and no-row behavior remain unchanged; only previously truncated definitions change.

Reviewer map

  • Start here: SnowflakeMetaData.view and SnowflakeMetaDataTest.
  • Failure condition: a definition differs from the exact JDBC DEFINITION value, null throws, or an empty result loses database/schema/view identity.
  • Rollback or disable path: Revert commit d305d2c69; no migration is required.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: OpenAI Codex assisted with diagnosis, implementation, automated tests, verification, CI monitoring, and adversarial review.

@HandSonic
HandSonic force-pushed the fix/snowflake-view-definition branch from d305d2c to 5ca0306 Compare September 3, 2026 18:47
Align existing OtterMind/Chat2DB PR OtterMind#2822 while preserving its focused fix.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants