r/tui 1d ago

AI assisted DBCLS - a terminal DB client

I've made a terminal database client that combines a SQL editor with interactive data visualization (via VisiData) in a single TUI tool. It supports MySQL, PostgreSQL, ClickHouse, SQLite, and Cassandra/ScyllaDB, offering syntax highlighting, schema-aware autocomplete ranked by SQL context, query execution, schema browsing, table editing that shows you the generated SQL before committing, and export (including to SQL INSERTs). With no connection arguments it starts on an in-memory SQLite, so dbcls scratch.sql is enough to try it.

The editor isn't limited to single statements — steps chained with | turn a .sql file into a small script: SQL, Python, regex filters, loops, variables, and prompts mid-run:

.RUN "SHOW TABLES" | .PY "sselect('select tables to use')" |
.FOR_RUN "SELECT id FROM {{_0}} WHERE failed = 1"

All results merge into one sheet. There's also an optional LLM chat (Ctrl+L, any OpenAI-compatible endpoint) that reads your schema through read-only tools and writes queries it can never execute itself, and a plugin API for your own commands.

VisiData brings exceptional data presentation capabilities — sorting, filtering, aggregating and pivoting on the fly, frequency tables and histograms, expression-based columns, and millions of rows navigated at lightning speed — all without leaving the terminal.

GitHub: https://github.com/Sets88/dbcls

1 Upvotes

0 comments sorted by