AI SQL Query Builder
sqlsure
Open-source semantic SQL inspector that catches double-counting, wrong join keys, and additivity violations before queries run, with zero network calls.
sqlsure
What is sqlsure?
sqlsure is an open-source tool that inspects SQL queries against a semantic model to detect data integrity errors like fan-out double-counting, chasm traps, additivity violations, and policy breaches, all without accessing the database.
sqlsure vs Similar AI Tools
| Pricing Model | Free | Custom Pricing | Free | Free, Freemium |
| Free Credits | ||||
| Key Features |
|
|
|
|
| Pros |
|
|
|
|
| Cons |
|
|
|
|
| Best For |
|
|
|
|
How to use sqlsure?
- 1Install: pip install sqlsure
- 2Define a semantic model from dbt, PK/FK, or introspect from database
- 3Check queries with check() or CLI: python -m sqlsure.cli --model model.json query.sql
sqlsure Key Features
- Detects fan-out double-counting (FANOUT rule)
- Detects chasm traps from multiple fan-out joins (CHASM rule)
- Validates additivity of measures (ADDITIVITY rule)
- Checks join keys against declared relationships (JOIN_KEY rule)
- Warns on cross joins and undeclared joins
- Policy checks for sensitive columns (SENSITIVE_COLUMN)
- Provides machine-actionable fix suggestions
- Deterministic, offline, no data access required
sqlsure Use Cases
- CI/CD gate for SQL queries in data pipelines
- Guardrail for AI text-to-SQL agents
- Auditing dbt repos for semantic correctness
- Embedding into data products for query safety
sqlsure Pricing & Free Credits
sqlsure currently operates on a Free model.
This tool is completely free to use
sqlsure Pros & Cons
Pros
- Deterministic and auditable results
- Zero false positives on benchmark audits
- Works offline with no data access
- Integrates with dbt and existing PK/FK declarations
- Provides actionable fix suggestions for AI agents
Cons
- Requires a semantic model or rulebook to be defined
- Currently limited to rule set v0.1
- Only supports SQL with declared relationships or metrics
What is sqlsure best for?
- Data engineers ensuring query correctness
- AI developers building text-to-SQL systems
- Analytics teams preventing silent data errors