Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
--ignore=tests/test_duckdb.py \
--ignore=tests/test_cockroachdb.py \
--ignore=tests/test_turso.py \
--ignore=tests/test_firebird.py \
--ignore=tests/test_ssh.py \
--ignore=tests/test_clickhouse.py

Expand Down Expand Up @@ -401,6 +402,44 @@ jobs:
run: |
pytest tests/test_cockroachdb.py -v --timeout=120

test-firebird:
runs-on: ubuntu-latest
needs: build

services:
firebird:
image: firebirdsql/firebird:5.0.3-noble
env:
FIREBIRD_USER: testuser
FIREBIRD_PASSWORD: TestPassword123!
FIREBIRD_DATABASE: /var/lib/firebird/data/test_sqlit.fdb
ports:
- 3050:3050

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
pip install firebirdsql

- name: Run Firebird integration tests
env:
FIREBIRD_HOST: localhost
FIREBIRD_PORT: 3050
FIREBIRD_USER: testuser
FIREBIRD_PASSWORD: TestPassword123!
FIREBIRD_DATABASE: /var/lib/firebird/data/test_sqlit.fdb
run: |
pytest tests/test_firebird.py -v --timeout=120

test-clickhouse:
runs-on: ubuntu-latest
needs: build
Expand Down
13 changes: 12 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pytest tests/ -v -k sqlite

### Full Test Suite (Requires Docker)

To run the complete test suite including SQL Server, PostgreSQL, MySQL, MariaDB, Oracle, DuckDB, and CockroachDB tests:
To run the complete test suite including SQL Server, PostgreSQL, MySQL, MariaDB, FirebirdSQL, Oracle, DuckDB, and CockroachDB tests:

1. Start the test database containers:
```bash
Expand All @@ -53,6 +53,7 @@ pytest tests/ -v -k mssql # SQL Server only
pytest tests/ -v -k PostgreSQL # PostgreSQL only
pytest tests/ -v -k MySQL # MySQL only
pytest tests/ -v -k cockroach # CockroachDB only
pytest tests/ -v -k firebird # FirebirdSQL only
```

### Environment Variables
Expand Down Expand Up @@ -94,6 +95,15 @@ The database tests can be configured with these environment variables:
| `COCKROACHDB_PASSWORD` | `` | CockroachDB password (empty for the included Docker container) |
| `COCKROACHDB_DATABASE` | `test_sqlit` | CockroachDB database |

**FirebirdSQL:**
| Variable | Default | Description |
|----------|---------|-------------|
| `FIREBIRD_HOST` | `localhost` | Firebird hostname |
| `FIREBIRD_PORT` | `3050` | Firebird port |
| `FIREBIRD_USER` | `testuser` | Firebird username |
| `FIREBIRD_PASSWORD` | `TestPassword123!` | Firebird password |
| `FIREBIRD_DATABASE` | `/var/lib/firebird/data/test_sqlit.fdb` | Firebird database path or alias |

### CockroachDB Quickstart (Docker)

1. Start the included CockroachDB container:
Expand Down Expand Up @@ -204,6 +214,7 @@ Rationale: E;Q;R satisfies both intuitiveness (each binding is the first letter

- **PostgreSQL Tests**: Runs PostgreSQL integration tests with Docker service
- **MySQL Tests**: Runs MySQL integration tests with Docker service
- **Firebird Tests**: Runs Firebird integration tests with Docker service
- **MariaDB/Oracle/DuckDB/CockroachDB Tests**: Runs the remaining database integration tests with Docker service where applicable
- **Full Test Suite**: Runs all tests across every supported database

Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sqlit

**The lazygit of SQL databases.** Connect to Postgres, MySQL, SQL Server, SQLite, ClickHouse, Supabase, Turso, and more from your terminal in seconds.
**The lazygit of SQL databases.** Connect to Postgres, MySQL, SQL Server, SQLite, ClickHouse, FirebirdSQL, Supabase, Turso, and more from your terminal in seconds.

A lightweight TUI for people who just want to run some queries fast.

Expand All @@ -23,7 +23,7 @@ A lightweight TUI for people who just want to run some queries fast.

- **Connection manager UI** - Save connections, switch between databases without CLI args
- **Just run `sqlit`** - No CLI config needed, pick a connection and go
- **Multi-database out of the box** - SQL Server, PostgreSQL, MySQL, SQLite, MariaDB, Oracle, DuckDB, CockroachDB, ClickHouse, Supabase, Turso - no adapters to install
- **Multi-database out of the box** - SQL Server, PostgreSQL, MySQL, SQLite, MariaDB, FirebirdSQL, Oracle, DuckDB, CockroachDB, ClickHouse, Supabase, Turso - no adapters to install
- Connect directly to database docker container
- **SSH tunnels built-in** - Connect to remote databases securely with password or key auth
- **Vim-style editing** - Modal editing for terminal purists
Expand All @@ -48,7 +48,7 @@ The problem got severely worse when I switched to Linux and had to rely on VS CO

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, CockroachDB, ClickHouse, Supabase, and Turso, and is designed to make it easy and enjoyable to access your data, not painful.
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, FirebirdSQL, Oracle, DuckDB, CockroachDB, ClickHouse, Supabase, and Turso, and is designed to make it easy and enjoyable to access your data, not painful.


## Installation
Expand Down Expand Up @@ -103,6 +103,7 @@ sqlit connections add mysql --name "MyMySQL" --server "localhost" --username "us
sqlit connections add cockroachdb --name "MyCockroach" --server "localhost" --port "26257" --database "defaultdb" --username "root"
sqlit connections add sqlite --name "MyLocalDB" --file-path "/path/to/database.db"
sqlit connections add turso --name "MyTurso" --server "libsql://your-db.turso.io" --password "your-auth-token"
sqlit connections add firebird --name "MyFirebird" --server "localhost" --username "user" --password "pass" --database "employee"

# Connect via SSH tunnel
sqlit connections add postgresql --name "RemoteDB" --server "db-host" --username "dbuser" --password "dbpass" \
Expand Down Expand Up @@ -210,6 +211,7 @@ Most of the time you can just run `sqlit` and connect. If a Python driver is mis
| ClickHouse | `clickhouse-connect` | `pipx inject sqlit-tui clickhouse-connect` | `python -m pip install clickhouse-connect` |
| Turso | `libsql-client` | `pipx inject sqlit-tui libsql-client` | `python -m pip install libsql-client` |
| Cloudflare D1 | `requests` | `pipx inject sqlit-tui requests` | `python -m pip install requests` |
| Firebird | `firebirdsql` | `pip install firebirdsql` | `python -m pip install firebirdsql` |

**Note:** SQL Server also requires the platform-specific ODBC driver. On your first connection attempt, `sqlit` can help you install it if it's missing.

Expand Down
20 changes: 20 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,26 @@ services:
retries: 10
start_period: 10s

firebird:
image: firebirdsql/firebird:5.0.3-noble
container_name: sqlit-test-firebird
environment:
FIREBIRD_USER: "testuser"
FIREBIRD_PASSWORD: "TestPassword123!"
FIREBIRD_DATABASE: "/var/lib/firebird/data/test_sqlit.fdb"
ports:
- "3050:3050"
healthcheck:
# Firebird doesn't come with a straightforward health check, but this
# ought to be enough, I hope...
test: ["CMD", "nc", "-vz", "localhost", "3050"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
tmpfs:
- /var/lib/firebird/data

# SSH server for testing SSH tunnel connections
# Connects to postgres container on docker network
ssh:
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ build-backend = "hatchling.build"
[project]
name = "sqlit-tui"
version = "0.5.1"
description = "A terminal UI for SQL Server, PostgreSQL, MySQL, SQLite, and Oracle"
description = "A terminal UI for SQL Server, PostgreSQL, MySQL, SQLite, Oracle, and more"
readme = "README.md"
license = "MIT"
requires-python = ">=3.10"
authors = [
{ name = "Peter" }
]
keywords = ["sql", "server", "tui", "database", "mssql", "postgresql", "mysql", "sqlite", "oracle", "terminal"]
keywords = ["sql", "server", "tui", "database", "mssql", "postgresql", "mysql", "sqlite", "oracle", "firebird", "terminal"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
Expand Down Expand Up @@ -45,6 +45,7 @@ all = [
"clickhouse-connect>=0.7.0",
"requests>=2.32.4", # min avoids known CVEs
"libsql-client>=0.1.0",
"firebirdsql>=1.3.5",
"sshtunnel>=0.4.0",
"paramiko>=2.0.0,<4.0.0",
]
Expand All @@ -58,6 +59,7 @@ duckdb = ["duckdb>=1.1.0"] # min avoids known CVEs
clickhouse = ["clickhouse-connect>=0.7.0"]
d1 = ["requests>=2.32.4"] # min avoids known CVEs
turso = ["libsql-client>=0.1.0"]
firebird = ["firebirdsql>=1.3.5"]
ssh = [
"sshtunnel>=0.4.0",
"paramiko>=2.0.0,<4.0.0",
Expand Down Expand Up @@ -112,6 +114,7 @@ markers = [
"postgresql: PostgreSQL database tests",
"mysql: MySQL database tests",
"oracle: Oracle database tests",
"firebird: Firebird database tests",
"clickhouse: ClickHouse database tests",
"asyncio: async tests",
"integration: integration tests (may require external services)",
Expand Down
1 change: 1 addition & 0 deletions sqlit/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class DatabaseType(str, Enum):
SUPABASE = "supabase"
TURSO = "turso"
D1 = "d1"
FIREBIRD = "firebird"

else:
DatabaseType = Enum("DatabaseType", {t.upper(): t for t in _get_supported_db_types()}) # type: ignore[misc]
Expand Down
3 changes: 3 additions & 0 deletions sqlit/db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
# Adapters (lazy via __getattr__)
"CockroachDBAdapter",
"DuckDBAdapter",
"FirebirdAdapter",
"MariaDBAdapter",
"MySQLAdapter",
"OracleAdapter",
Expand All @@ -56,6 +57,7 @@
if TYPE_CHECKING:
from .adapters.cockroachdb import CockroachDBAdapter
from .adapters.duckdb import DuckDBAdapter
from .adapters.firebird import FirebirdAdapter
from .adapters.mariadb import MariaDBAdapter
from .adapters.mssql import SQLServerAdapter
from .adapters.mysql import MySQLAdapter
Expand Down Expand Up @@ -88,6 +90,7 @@ def get_all_schemas() -> Any:
# Adapters (through sqlit.db.adapters, which itself lazy-loads)
"CockroachDBAdapter": ("sqlit.db.adapters", "CockroachDBAdapter"),
"DuckDBAdapter": ("sqlit.db.adapters", "DuckDBAdapter"),
"FirebirdAdapter": ("sqlit.db.adapters", "FirebirdAdapter"),
"MariaDBAdapter": ("sqlit.db.adapters", "MariaDBAdapter"),
"MySQLAdapter": ("sqlit.db.adapters", "MySQLAdapter"),
"OracleAdapter": ("sqlit.db.adapters", "OracleAdapter"),
Expand Down
2 changes: 2 additions & 0 deletions sqlit/db/adapters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"ClickHouseAdapter",
"CockroachDBAdapter",
"DuckDBAdapter",
"FirebirdAdapter",
"MariaDBAdapter",
"MySQLAdapter",
"OracleAdapter",
Expand All @@ -39,6 +40,7 @@
from .clickhouse import ClickHouseAdapter
from .cockroachdb import CockroachDBAdapter
from .duckdb import DuckDBAdapter
from .firebird import FirebirdAdapter
from .mariadb import MariaDBAdapter
from .mssql import SQLServerAdapter
from .mysql import MySQLAdapter
Expand Down
Loading