feat: add demo.sql with 5 impactful SQL checker issues - #2
Open
sauravsrijan wants to merge 2 commits into
Open
Conversation
- demo.sql showcases 5 production-level SQL issues: - AM09: LIMIT without ORDER BY (non-deterministic results) - AM05: Unqualified JOINs (ambiguity) - AM08: Implicit cross JOINs (logic bugs) - CP01: Inconsistent keyword capitalization (standards) - AL01: Implicit table aliasing (clarity) - 37 lines of realistic e-commerce SQL patterns - 9 comprehensive pytest tests verify all violations detected Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Refactored test_demo_sql.py with full type hints, Google-style docstrings, and structured error handling following company baseline standards - Standardized SQL formatting across all files (sql1-4.sql, demo.sql) with consistent indentation and spacing - Removed unnecessary comments and documentation blocks per production requirements - All 9 tests verified passing with pytest Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added a new demonstration file (
demo.sql) showcasing 5 of the most impactful SQLFluff violations that are critical in production SQL. This golden test file helps demonstrate the importance of proper SQL linting practices.Changes
demo.sql (37 lines): Production-grade SQL examples featuring:
test_demo_sql.py (100+ lines): Comprehensive pytest test suite with 9 tests:
Test Results
All 9 tests pass:
Running `sqlfluff lint demo.sql --dialect postgres` detects all 5 critical violations.
Context
This repository contains golden test files with intentional SQL violations to demonstrate SQLFluff's linting capabilities. The demo.sql file provides realistic, production-level examples that are useful for:
🤖 Generated with Claude Code