PROJECT 31 • DAY 17 OF 90 • DATABASE DEVTOOLS & OPTIMIZER

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.

Next.js 15React 19FastAPIDuckDBSQLGlot97/97 Pytest
QueryTrellis Studio Preview
SQL ACADEMY
21 Interactive Lessons
PYTEST SUITE
97 / 97 Passed (74%)
7 Workspaces
Query, IDE, Debug, Opt, Academy
4 Dialects
Postgres • MySQL • SQLite • MSSQL
3-Tier Opt
AST • Plan • EXPLAIN ANALYZE
97 / 97
Automated Pytest Passed
01 / Overview

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.

01

Schema-Grounded Query Studio

Translates natural language prompts against active database schemas, asks structured clarification questions for ambiguities, and blocks nonexistent table hallucinations.

02

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.

03

Automated SQL Debugger

Diagnoses missing tables, ambiguous columns, missing JOIN predicates, three-valued NULL bugs, and datatype mismatches, generating interactive Monaco diff patches.

04

Three-Tier Query Optimizer

Enforces static AST suggestions + index DDL recommendations, non-executing estimated EXPLAIN plans, and opt-in measured EXPLAIN ANALYZE execution timing.

05

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.

06

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.

02 / Architecture

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.

STAGE 01

Schema Ingest

Inspect catalog & isolated DuckDB sandbox.

→
STAGE 02

NL Synthesis

Translate prompt to schema-grounded SQL.

→
STAGE 03

AST Debugger

Detect syntax & logic flaws with diff fixes.

→
STAGE 04

3-Tier Optimize

AST hints, EXPLAIN plan & A/B benchmarks.

→
STAGE 05

Monaco & Academy

Interactive IDE & 21 visual lessons.

03 / Screenshots

APPLICATION SCREENSHOTS.

Live screens captured from the running application. Click any image to view full size, or follow setup instructions in the GitHub repository.

04 / Technical Details

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)
05 / Tech Stack

CORE TECHNOLOGIES.

Frameworks, databases, visualization tools, and testing libraries used in QueryTrellis Studio.

FRONTEND STACK
Next.js 15 • React 19 • Tailwind v4
CODE EDITOR
Monaco Editor (Offline Bundled)
BACKEND API
FastAPI • Pydantic v2 • Python 3.11+
SQL ENGINES
SQLGlot • DuckDB • PostgreSQL
VISUALIZATION
Lucide Icons • Recharts
VERIFICATION
97/97 Pytest Passed (74% Coverage)
06 / Next Steps

FUTURE ENHANCEMENTS.

Upcoming improvements planned for QueryTrellis Studio.

Query plan visual flamegraph analyzer for recursive CTE execution bottlenecks.
Automated index creation impact simulator running on transient DuckDB clones.
Natural language data visualization generator emitting interactive Vega-Lite charts.
Team query catalog with shared snippet collections and execution runbooks.
Database schema migration diff generator outputting reversible Alembic migrations.
PostgreSQL pg_stat_statements automated slow-query audit daemon connector.
OPEN-SOURCE PROJECT • GITHUB.COM/RAGURAMRRP

EXPLORE SOURCE & DOCS.

View the complete codebase, sample datasets, quick-launch scripts, and automated test suites on GitHub.