sqlide
A DataGrip-style SQL IDE that runs in your terminal. Connect to any database over JDBC, write SQL in an editor that outlines the statement about to run, and browse results in sortable, copyable tables that export to CSV, XLSX and more.
Works on Linux, macOS and WSL.
Features
- Any JDBC database. PostgreSQL and ClickHouse work out of the box; MySQL, MariaDB, Oracle, SQL Server, H2, SQLite and DuckDB are one keypress away. Add your own driver from jar files or Maven coordinates, as in DataGrip. Drivers are downloaded from Maven Central (checksum verified) and each one gets its own class loader.
- Framed statement. The statement under the cursor is outlined in the gutter;
F5runs it, a selection runs the selection,Shift+F5runs the whole file. Dialect-aware splitting:$$quotes, nested comments, Oracle/, SQL ServerGO, procedural blocks. - Result grid. Sort by several columns, filter, select a rectangle, view long values,
load more rows on demand. Copy as TSV, CSV, Markdown, JSON or
INSERTstatements. - Export. CSV, TSV, JSON, JSON Lines, Markdown, SQL inserts, HTML, XLSX. Export the loaded rows or re-run the query and stream the full result to disk, with progress and cancel.
- Schema tree and autocomplete. Lazy metadata,
SELECT *on Enter, alias-aware column completion, keywords and functions per dialect. Like DataGrip, you choose what to show: on the first connect to a database with several schemas a picker opens (schemas or databases, plus a table name filter such asfact_*); until you choose, only the working schema is loaded.Sin the tree reopens the picker; the choice is saved per connection. - Consoles and files. Tabs with their own connection; consoles autosave and come back
after a restart; open and save
.sqlfiles (sqlide a.sql b.sql). - History, formatting, transactions. Searchable query history, SQL formatting, Auto/Manual commit with Commit/Rollback.
- Rebindable keys, themes, command palette (
Ctrl+P). No AI features.
Install
Requirements: Python 3.12+ and a Java 11+ runtime (brew install openjdk,
apt install openjdk-21-jre, ...). Check with sqlide doctor.
uv tool install sqlide # or: pipx install sqlide
sqlide
Homebrew formula: see packaging/homebrew.
Quick start
sqlide driver install postgres # or just connect: sqlide offers to download it
sqlide # Ctrl+N: new connection, Enter on it: connect
Passwords are never written to disk. sqlide asks when you connect and keeps the password
in memory until you quit. A connection can instead read it from an environment variable
(password_ref = "${env:PGPASSWORD}") or from a command such as a keychain CLI
(password_cmd = "security find-generic-password -s mydb -w").
Keys
sqlide keys prints every rebindable action with its default key. Override in
~/.config/sqlide/keymap.toml:
[keys]
"editor.run" = "f4"
| Action | Keys |
|---|---|
| Run statement / selection | F5, Ctrl+J, Ctrl+Enter* |
| Run all | Shift+F5 |
| Cancel query | Ctrl+F2 |
| Autocomplete | Ctrl+Space (opens by itself after a dot) |
| Format / comment | F7 or Ctrl+Alt+L / Ctrl+/ or Alt+/ |
| New connection / console / close tab | Ctrl+N / Ctrl+T / Alt+W |
| Open / save file | Ctrl+O / Ctrl+S |
| History | Alt+E |
| Switch tab | Alt+← Alt+→ |
| Focus connections / schema / editor / results | Alt+C / Alt+D / Alt+Q / Alt+R (or F6 / Shift+F6 to cycle) |
| Tx: toggle / commit / rollback | F8 / F9 / F10 |
| Grid: sort / copy / copy as / filter / export | s / Ctrl+C / y / / / e |
| Command palette | Ctrl+P |
| Quit | Ctrl+Q |
* Most terminals send Ctrl+Enter as plain Enter; it only works where the terminal
speaks the kitty keyboard protocol. Alt+Enter is not used on purpose: it toggles
full screen in Windows Terminal.
Files
| What | Where (Linux and WSL; macOS uses the platform equivalents) |
|---|---|
| Settings, connections, custom drivers, keymap | ~/.config/sqlide/ |
| Downloaded drivers, history, consoles | ~/.local/share/sqlide/ |
Override with SQLIDE_CONFIG_DIR and SQLIDE_DATA_DIR.
Notes
- Schema reads (tree, autocomplete) use a second connection, so they work while a query runs.
For in-memory databases (H2
mem:, SQLite:memory:, DuckDB) a second connection would see a different database, so the query connection is shared and reads wait for a running query. - Nothing polls the database. Structure is read on demand (expanding a node, autocomplete) and
cached. After DDL in the editor the cache is dropped and the tree shows "F5 to refresh"; press
F5in the tree to re-read it, also for changes made by other clients. In manual-commit mode new objects appear after Commit. - MySQL
DELIMITER xlines are understood (they are not sent to the server). On SQL Server,CREATE PROCEDURE/FUNCTION/TRIGGERwithoutBEGIN..ENDruns up to the nextGO, as T-SQL does. Alt+1..Alt+4only work in terminals with the kitty keyboard protocol; most terminals deliver them as Mac characters, so use the letter keys orF6.- Tested on Linux and WSL against PostgreSQL, MySQL, MariaDB, ClickHouse, SQL Server, Oracle and H2. macOS is covered by CI. On Windows, run it inside WSL (native Windows is not supported).
Development
uv sync
uv run pytest # unit, H2 integration, Textual pilot tests
uv run pytest -m docker # also PostgreSQL in Docker
uv run ruff check && uv run pyright
The code is split into blocks that depend only downwards: ui → db, sql, grid, export, history, config → jvm, drivers. The core never imports the UI.
License
MIT
Metadata
Release files for sqlide 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sqlide-0.1.3.tar.gz | 205.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sqlide-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 315.0 kB
Release files / sqlide-0.1.3.tar.gz
| Download URL | sqlide-0.1.3.tar.gz |
|---|---|
| Size | 205.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b9fef2e3c4664b033a41f279617adbaf9a3481a3935258c1bb329ed26de9f58
|
|
BLAKE2b-256 checksum How to use checksums |
e04c2a7926d34eb933e78f9af35108924c5b14ab346400e4e68b3e02ba2f22e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / sqlide-0.1.3-py3-none-any.whl
| Download URL | sqlide-0.1.3-py3-none-any.whl |
|---|---|
| Size | 109.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
712e476a74df96d494714cfcf1aea79e224c491de548e1679bfbbb88e3509e4c
|
|
BLAKE2b-256 checksum How to use checksums |
ef6c8a5e8691caabb07b0a929b3f739c2574b60524d3d2da1264200dea17b88c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|