Skip to content

Conversation

@h3n4l
Copy link
Member

@h3n4l h3n4l commented Nov 3, 2025

Summary

Add ANTLR4-based Snowflake SQL parser from the snowsql-parser repository into the parser monorepo.

Changes

  • Add snowflake parser directory with complete parser implementation

    • Grammar files: SnowflakeLexer.g4, SnowflakeParser.g4
    • Build script: build_id_contains_non_reserved_keywords.py
    • Makefile with build and test targets (follows existing pattern)
    • README documentation
  • Test coverage: 25 SQL test examples covering:

    • DDL statements (CREATE, ALTER, DROP)
    • DML statements (SELECT, INSERT, MERGE)
    • Snowflake-specific features (alerts, dynamic tables, materialized views)
    • Advanced syntax (COPY, SHOW, DESCRIBE, GRANT, etc.)
  • Package updates:

    • Updated package name: github.com/bytebase/parser/snowflake
    • Fixed import paths in test files
    • Generated Go parser files using ANTLR 4
  • CI/CD integration:

    • Added snowflake to the parser list in .github/workflows/tests.yml
    • Tests will run automatically on changes to snowflake/ directory

Test Results

All 25 test cases pass successfully:

PASS: TestSnowflakeSQLParser (1.562s)

Migration Notes

This moves the parser from the standalone snowsql-parser repository into the unified parser monorepo alongside PostgreSQL, Redshift, and CQL parsers.

🤖 Generated with Claude Code

Add ANTLR4-based Snowflake SQL parser from snowsql-parser repository into the parser monorepo.

Changes:
- Add snowflake/ directory with grammar files (SnowflakeLexer.g4, SnowflakeParser.g4)
- Add Makefile with build and test targets following the pattern of other parsers
- Include 25 SQL test examples covering various Snowflake syntax features
- Update package name and import paths to github.com/bytebase/parser/snowflake
- Add snowflake to CI workflow to run tests automatically
- All 25 test cases passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@h3n4l h3n4l merged commit 2b2fa56 into main Nov 3, 2025
5 checks passed
@h3n4l h3n4l deleted the add-snowflake-parser branch November 3, 2025 09:03
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.

2 participants