QUERYTRELLIS
SQL WORKBENCH.
A full-stack, schema-grounded Natural Language SQL IDE, multi-dialect editor, AST debugger, query optimizer, and visual learning platform — running 100% locally with DuckDB sandboxes, Monaco editing, three-tier EXPLAIN ANALYZE performance tuning, and 21 interactive SQL Academy lessons.
BRIDGING PLAIN ENGLISH AND HIGH-PERFORMANCE SQL.
Writing and tuning complex relational queries requires navigating syntax errors, indexing bottlenecks, and subtle dialect differences. QueryTrellis Studio unifies natural language synthesis, Monaco IDE editing, automated AST bug fixing, and execution plan benchmarks.
Schema-Grounded Query Studio
Translates natural language prompts against active database schemas, asks structured clarification questions for ambiguities, and blocks nonexistent table hallucinations.
Multi-Dialect Monaco SQL IDE
Offline-bundled Monaco editor supporting PostgreSQL, MySQL, SQLite, and SQL Server with AST syntax validation, schema tree explorer, and CSV/JSON export.
Automated SQL Debugger
Diagnoses missing tables, ambiguous columns, missing JOIN predicates, three-valued NULL bugs, and datatype mismatches, generating interactive Monaco diff patches.
Three-Tier Query Optimizer
Enforces static AST suggestions + index DDL recommendations, non-executing estimated EXPLAIN plans, and opt-in measured EXPLAIN ANALYZE execution timing.
Visual SQL Academy (21 Lessons)
Interactive curriculum across Beginner to Advanced tiers featuring DuckDB step-by-step execution traces, progressive hints, and a custom query tracer.
Database Sandbox & Safety Guardrails
Uploads .sql, .csv, and .json files into isolated DuckDB sandboxes, connects live external databases, and enforces strict read-only / HMAC-confirmed write policies.
HOW IT WORKS.
Next.js 15 workbench communicates with FastAPI services executing SQLGlot AST analysis, DuckDB sandboxing, and dialect transpilation with zero external daemon dependencies.
Schema Ingest
Inspect catalog & isolated DuckDB sandbox.
NL Synthesis
Translate prompt to schema-grounded SQL.
AST Debugger
Detect syntax & logic flaws with diff fixes.
3-Tier Optimize
AST hints, EXPLAIN plan & A/B benchmarks.
Monaco & Academy
Interactive IDE & 21 visual lessons.
APPLICATION SCREENSHOTS.
Live screens captured from the running application. Click any image to view full size, or follow setup instructions in the GitHub repository.
OPTIMIZATION TIERS & AST COMPILER SPECIFICATIONS.
Key modules, rules, safety checks, and automated test results documented in the repository.
| Subsystem | Engineering Implementation | Safety & Performance Guarantee |
|---|---|---|
| NL-to-SQL Compiler | SQLGlot AST + DuckDB schema grounding | Zero hallucinated table or column identifiers |
| Three-Tier Optimizer | AST heuristics + EXPLAIN + EXPLAIN ANALYZE | Side-by-side A/B execution timing verification |
| Write Guardrails | Read-only enforcement + HMAC confirmation | Blocks accidental DROP / UPDATE data loss |
| Test Verification | pytest suite across AST, parser & optimizer | 97 / 97 Passed (74% line coverage) |
CORE TECHNOLOGIES.
Frameworks, databases, visualization tools, and testing libraries used in QueryTrellis Studio.
FUTURE ENHANCEMENTS.
Upcoming improvements planned for QueryTrellis Studio.
EXPLORE SOURCE & DOCS.
View the complete codebase, sample datasets, quick-launch scripts, and automated test suites on GitHub.