Skip to main content

A terminal UI for SQL Server, PostgreSQL, MySQL, SQLite, and Oracle

Project description

sqlit

A simple terminal UI for SQL Server, PostgreSQL, MySQL, SQLite, and more—built for people who just want to run some queries fast.

Python License

Multi-database Support

Database Providers

Query History

Query History

Features

  • Multi-database support: SQL Server, PostgreSQL, MySQL, SQLite, MariaDB, Oracle, DuckDB, and CockroachDB
  • Query history: Automatically saves queries per connection, searchable and sortable
  • Fast and intuitive keyboard only control
  • Context based help (no need to memorize tons of hot-keys)
  • Browse databases, tables, views, and stored procedures
  • Execute SQL queries with syntax highlighting
  • Vim-style query editing
  • SQL autocomplete for tables, columns, and procedures
  • Multiple authentication methods (Windows, SQL Server, Entra ID)
  • Save and manage connections
  • Responsive terminal UI
  • CLI mode for scripting and AI agents
  • Themes (Tokyo Night, Nord, and more)
  • Auto-detects and installs ODBC drivers (SQL Server)

Motivation

I usually do my work in the terminal, but I found myself either having to boot up massively bloated GUI's like SSMS or Vscode for the simple task of merely browsing my databases and doing some queries toward them. For the vast majority of my use cases, I never used any of the advanced features for inspection and debugging that SSMS and other feature-rich clients provide.

I had the unfortunate situation where doing queries became a pain-point due to the massive operation it is to open SSMS and it's lack of intuitive keyboard only navigation.

The problem got severely worse when I switched to Linux and had to rely on VS CODE's SQL extension to access my database. Something was not right.

I tried to use some existing TUI's for SQL, but they were not intuitive for me and I missed the immediate ease of use that other TUI's such as Lazygit provides.

sqlit is a lightweight database TUI that is easy to use and beautiful to look at, just connect and query. It's for you that just wants to run queries toward your database without launching applications that eats your ram and takes time to load up. Sqlit supports SQL Server, PostgreSQL, MySQL, SQLite, MariaDB, Oracle, DuckDB, and CockroachDB, and is designed to make it easy and enjoyable to access your data, not painful.

Installation

pip install sqlit-tui

For SQL Server, sqlit will detect if you're missing ODBC drivers and help you install them.

For PostgreSQL, CockroachDB, and MySQL, install the optional drivers:

# PostgreSQL / CockroachDB
pip install psycopg2-binary

# MySQL
pip install mysql-connector-python

SQLite works out of the box with no additional dependencies.

Usage

sqlit

The keybindings are shown at the bottom of the screen.

CLI

# Run a query
sqlit query -c "MyConnection" -q "SELECT * FROM Users"

# Output as CSV or JSON
sqlit query -c "MyConnection" -q "SELECT * FROM Users" --format csv
sqlit query -c "MyConnection" -f "script.sql" --format json

# Create connections for different databases
sqlit connection create --name "MySqlServer" --db-type mssql --server "localhost" --auth-type sql
sqlit connection create --name "MyPostgres" --db-type postgresql --server "localhost" --username "user" --password "pass"
sqlit connection create --name "MyMySQL" --db-type mysql --server "localhost" --username "user" --password "pass"
sqlit connection create --name "MyCockroach" --db-type cockroachdb --server "localhost" --port "26257" --database "defaultdb" --username "root"
sqlit connection create --name "MyLocalDB" --db-type sqlite --file-path "/path/to/database.db"

# Manage connections
sqlit connection list
sqlit connection delete "MyConnection"

Keybindings

Key Action
i Enter INSERT mode
Esc Back to NORMAL mode
e / q / r Focus Explorer / Query / Results
s SELECT TOP 100 from table
h Query history
d Clear query
n New query (clear all)
Ctrl+P Command palette
Ctrl+Q Quit
? Help

Autocomplete triggers automatically in INSERT mode. Use Tab to accept.

You can also receive autocompletion on columns by typing the table name and hitting "."

Configuration

Connections and settings are stored in ~/.sqlit/.

Contributing

See CONTRIBUTING.md for development setup, testing, CI, and CockroachDB quickstart steps.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqlit_tui-0.3.1.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqlit_tui-0.3.1-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file sqlit_tui-0.3.1.tar.gz.

File metadata

  • Download URL: sqlit_tui-0.3.1.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sqlit_tui-0.3.1.tar.gz
Algorithm Hash digest
SHA256 764f1751cfd2315431e0938d6a1ae2f7972e5faf60fcf860160399231a1fd9c6
MD5 d02a7187a84c377e830cbd953fb93b45
BLAKE2b-256 275b6e7e01d9339c40a36613c0c7b10dacf903901a53ce9c0474e0e2b9b6c303

See more details on using hashes here.

Provenance

The following attestation bundles were made for sqlit_tui-0.3.1.tar.gz:

Publisher: release.yml on Maxteabag/sqlit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sqlit_tui-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: sqlit_tui-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sqlit_tui-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 776a69efd70e962461d9c1b9de3f212bc4272968d0cac3f6ee902413620d0d20
MD5 60cfc2cf7f6ea1a1105ebcc18718a346
BLAKE2b-256 b20fdcc14ae656d2e05ba10f5668a061fa7e42eb3b35fe20feca7afa3b86afac

See more details on using hashes here.

Provenance

The following attestation bundles were made for sqlit_tui-0.3.1-py3-none-any.whl:

Publisher: release.yml on Maxteabag/sqlit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page