DEV Community

Cover image for I open-sourced SQL Studio, a native Postgres client with privacy-first AI text-to-SQL
Suraj Sharma
Suraj Sharma

Posted on

I open-sourced SQL Studio, a native Postgres client with privacy-first AI text-to-SQL

I got tired of writing the same SQL by hand in DBeaver, so I built an alternative. Meet SQL Studio, now open source.

You type what you want in plain English, like "show me the top 10 customers by revenue last month". It writes the SQL into the editor. Nothing runs until you review it and click Run.

What it does:

Text-to-SQL built in. Generated queries are clearly marked "Generated by AI, not run yet", and a "Read-only" badge appears when the query can't change data.
Your data stays yours. The AI only sees table and column names. It never sees your rows, results or credentials. "Show prompt" lets you check exactly what gets sent, and the privacy behavior is covered by automated tests.
Use any model. It works with any OpenAI-compatible endpoint, including local models through Ollama.
You stay in control. Even after you click Run, DROP, TRUNCATE, and DELETE/UPDATE without WHERE ask for confirmation first.
Fast and light. It's a native desktop app with a lazy schema browser, a virtualised results grid, multiple tabs, saved scripts and crash-safe session restore.
Passwords live in the macOS Keychain, never in a config file.
How it's built:

Go backend and React + TypeScript frontend on Wails, with CodeMirror, TanStack Table and Radix UI.
Spec-driven development with GitHub Spec Kit. Every feature has a written spec, plan and task list in the repo (six so far), so you can read why things work the way they do.
Tested properly: 70+ Go test files and 60+ frontend test files, integration tests against a real PostgreSQL in Docker using testcontainers, and automated accessibility checks with axe.
Keyboard-first and accessible, with a documented shortcut for every core action.
No telemetry, no accounts. The only network traffic is to the servers you configure.
MIT licensed.
It's early (macOS and PostgreSQL only for now). The roadmap is public in the README: CSV/JSON export, query history, explain plans, MySQL/SQLite, and Windows/Linux. If you want to contribute, the specs and docs make it easy to get oriented, and issues and PRs are very welcome.

Repo: https://github.com/creativesuraj/sql-studio

If it's useful to you, a star helps a lot.

opensource #postgresql #sql #ai #developertools #golang #react

Top comments (0)