SculptQL
Local-first SQL IDE with zero-latency querying and visual schema exploration
Overview
Role
Solo Developer
Team
Solo
Timeline
Completed
Stack
6 technologies
Built a privacy-first SQL IDE that connects to 5 database dialects via CLI — credentials never leave the user's machine, connection pools are managed locally, and graceful shutdown prevents connection leaks.
The Problem
Situation
Database credentials are sensitive, and cloud-based SQL tools pose security risks by sending credentials over the network. Developers need a local-first solution that keeps credentials safe.
My Goal
Create a secure, local-first SQL IDE that supports multiple database types with zero-latency querying and visual schema exploration.
My Approach
Built CLI-based database connection with autocomplete to avoid exposing credentials
Developed dynamic query builder using Codemirror with syntax highlighting
Designed interactive ERD visualization engine with D3.js for mapping schema relations
Implemented offline persistence with IndexedDB for query history, templates, and schema metadata
Added support for 5+ database types including Postgres, Oracle, and SQLite
The Outcome
Built a privacy-first SQL IDE that connects to 5 database dialects via CLI — credentials never leave the user's machine, connection pools are managed locally, and graceful shutdown prevents connection leaks.
Engineered context-aware SQL autocompletion that understands cursor position: suggests foreign-key-based JOIN conditions after ON, aggregate functions in HAVING, and schema-aware columns after SELECT.
Implemented a dual-enforcement permission system (read-only / read-write / full) with real-time inline warnings as you type and server-side SQL parsing before execution.
Project Roadmap
MVP, stretch goals, and future vision
Project Roadmap
Development phases and milestones
Core SQL IDE
Functional SQL editor with database connectivity
SQL Code Editor
CodeMirror-powered editor with syntax highlighting
Query Execution Engine
Execute queries and display results in data grids
Database Connection Manager
Connect to PostgreSQL databases securely
Visual Database Tools
Schema visualization and enhanced productivity
ERD Visualization
Interactive entity-relationship diagrams with D3.js
Schema Browser
Navigate tables, columns, and relationships
Multi-Database Support
Support for multiple database engines
AI-Powered SQL
Natural language to SQL and intelligent assistance
Natural Language Queries
Convert plain English to SQL using AI
Query History & Favorites
Track and replay previous queries
ERD Export & Collaboration
Export diagrams and share with team
Query Performance Analyzer
EXPLAIN visualizer with optimization recommendations
Database Migration Tools
Schema comparison and migration generation
Interview Questions
Common questions, answered in STAR format
Technical Decisions
Why I chose X over Y
Key Trade-offs
Every decision has costs
Challenges & Solutions
The hardest problems I solved
Code Highlights
Key sections I'd walk through in a code review
Trie-based autocomplete index
src/lib/autocomplete/trieIndex.tsCustom trie implementation that indexes table names, column names, and common SQL keywords. Supports fuzzy matching for typo tolerance. The trie is built once on connection and stored in memory for instant lookups.
ERD force-directed layout
src/components/erd/forceLayout.tsCustom D3 force simulation with: attraction force between related tables, repulsion between unrelated tables, clustering by schema, and edge bundling. Tables with more relationships are weighted heavier so they anchor the center.
What I Learned
- →Canvas beats SVG for large visualizations - DOM has limits
- →Viewport culling essential - never render what user cannot see
- →Trie data structure makes autocomplete instant
- →Web Workers prevent heavy computation from blocking UI
- →Local-first more trustworthy for sensitive data like credentials
- →CodeMirror lighter than Monaco for single-language editing
- →Dynamic import heavy libraries - never block initial render
Future Plans
- +Export to multiple languages (Python, Go, Rust, not just JS/TS)
- +Export ERD as PNG/SVG for documentation
- +AI-assisted query generation from natural language
- +VS Code extension to bring SculptQL into the IDE
- +Support more databases (MongoDB, Redis)
Next project
Hoop Almanac
Want to discuss this project?