Introduction
Sqlit is a Python-based terminal user interface for interacting with SQL databases. It provides a visual way to browse schemas, write and execute queries, and explore results without leaving the terminal, supporting a wide range of database engines.
What Sqlit Does
- Connects to PostgreSQL, MySQL, SQLite, SQL Server, DuckDB, Turso, CockroachDB, MariaDB, and Oracle
- Displays database schemas with tables, columns, and types in a tree view
- Provides a query editor with syntax highlighting and auto-completion
- Shows query results in scrollable, sortable tables within the TUI
- Supports SSH tunneling for connecting to remote databases securely
Architecture Overview
Sqlit is built with Python using the Textual framework for its terminal interface. It uses SQLAlchemy as the database abstraction layer, providing consistent connectivity across database engines. The TUI renders a split-pane layout with a schema browser, query editor, and results table.
Self-Hosting & Configuration
- Install via pip or pipx for isolated installation
- Connect to databases using DSN connection strings
- Configure SSH tunnel parameters for remote database access
- Customize key bindings and display settings through a config file
- Supports storing connection profiles for quick switching
Key Features
- Multi-database support across nine major SQL engines in one tool
- Schema browsing with table and column inspection in a tree sidebar
- Query editor with SQL syntax highlighting and auto-complete
- SSH tunnel support for secure remote database connections
- Lightweight Python-based tool with no heavy dependencies
Comparison with Similar Tools
- pgcli/mycli — auto-completing CLI clients for single databases; Sqlit adds a visual TUI and multi-database support
- DBeaver — full GUI database tool; Sqlit stays in the terminal
- DataGrip — JetBrains IDE for databases; Sqlit is free and terminal-native
- usql — universal CLI for SQL databases; Sqlit adds a full TUI experience
- Harlequin — DuckDB-focused TUI; Sqlit supports more database engines
FAQ
Q: Does Sqlit support NoSQL databases? A: No. Sqlit is designed for SQL databases with relational schemas.
Q: Can I export query results? A: Yes. Results can be copied or exported from the TUI interface.
Q: Does it support multiple simultaneous connections? A: You connect to one database at a time, but switching between saved connection profiles is fast.
Q: What Python version is required? A: Python 3.9 or newer is required.