sqlit-tui 0.2.1__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/.github/workflows/ci.yml +119 -61
- sqlit_tui-0.3.1/CONTRIBUTING.md +130 -0
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/PKG-INFO +16 -103
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/README.md +12 -100
- sqlit_tui-0.3.1/demo-history.gif +0 -0
- sqlit_tui-0.3.1/demo-providers.gif +0 -0
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/docker-compose.test.yml +49 -0
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/pyproject.toml +5 -3
- sqlit_tui-0.3.1/sqlit/adapters.py +1258 -0
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/sqlit/app.py +519 -43
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/sqlit/commands.py +21 -12
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/sqlit/config.py +13 -6
- sqlit_tui-0.3.1/sqlit/fields.py +99 -0
- sqlit_tui-0.3.1/sqlit/screens.py +1396 -0
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/sqlit/widgets.py +66 -7
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/tests/conftest.py +564 -0
- sqlit_tui-0.3.1/tests/test_cockroachdb.py +188 -0
- sqlit_tui-0.3.1/tests/test_duckdb.py +213 -0
- sqlit_tui-0.3.1/tests/test_mariadb.py +186 -0
- sqlit_tui-0.3.1/tests/test_mssql.py +186 -0
- sqlit_tui-0.3.1/tests/test_mysql.py +186 -0
- sqlit_tui-0.3.1/tests/test_oracle.py +188 -0
- sqlit_tui-0.3.1/tests/test_postgresql.py +186 -0
- sqlit_tui-0.3.1/tests/test_sqlite.py +204 -0
- sqlit_tui-0.2.1/sqlit/adapters.py +0 -578
- sqlit_tui-0.2.1/sqlit/screens.py +0 -1081
- sqlit_tui-0.2.1/tests/test_integration.py +0 -801
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/.github/workflows/release.yml +0 -0
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/.gitignore +0 -0
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/LICENSE +0 -0
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/demo-connect.gif +0 -0
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/demo-query.gif +0 -0
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/sqlit/__init__.py +0 -0
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/sqlit/cli.py +0 -0
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/sqlit/drivers.py +0 -0
- {sqlit_tui-0.2.1 → sqlit_tui-0.3.1}/tests/__init__.py +0 -0
|
@@ -55,7 +55,7 @@ jobs:
|
|
|
55
55
|
|
|
56
56
|
- name: Run SQLite integration tests
|
|
57
57
|
run: |
|
|
58
|
-
pytest tests/ -v
|
|
58
|
+
pytest tests/test_sqlite.py -v --timeout=60
|
|
59
59
|
|
|
60
60
|
test-mssql:
|
|
61
61
|
runs-on: ubuntu-latest
|
|
@@ -115,7 +115,7 @@ jobs:
|
|
|
115
115
|
MSSQL_USER: sa
|
|
116
116
|
MSSQL_PASSWORD: TestPassword123!
|
|
117
117
|
run: |
|
|
118
|
-
pytest tests/ -v
|
|
118
|
+
pytest tests/test_mssql.py -v --timeout=120
|
|
119
119
|
|
|
120
120
|
test-postgresql:
|
|
121
121
|
runs-on: ubuntu-latest
|
|
@@ -159,7 +159,7 @@ jobs:
|
|
|
159
159
|
POSTGRES_PASSWORD: TestPassword123!
|
|
160
160
|
POSTGRES_DATABASE: test_sqlit
|
|
161
161
|
run: |
|
|
162
|
-
pytest tests/ -v
|
|
162
|
+
pytest tests/test_postgresql.py -v --timeout=120
|
|
163
163
|
|
|
164
164
|
test-mysql:
|
|
165
165
|
runs-on: ubuntu-latest
|
|
@@ -204,54 +204,68 @@ jobs:
|
|
|
204
204
|
MYSQL_PASSWORD: TestPassword123!
|
|
205
205
|
MYSQL_DATABASE: test_sqlit
|
|
206
206
|
run: |
|
|
207
|
-
pytest tests/ -v
|
|
207
|
+
pytest tests/test_mysql.py -v --timeout=120
|
|
208
208
|
|
|
209
|
-
test-
|
|
209
|
+
test-oracle:
|
|
210
210
|
runs-on: ubuntu-latest
|
|
211
|
-
needs:
|
|
211
|
+
needs: build
|
|
212
212
|
|
|
213
213
|
services:
|
|
214
|
-
|
|
215
|
-
image:
|
|
214
|
+
oracle:
|
|
215
|
+
image: gvenzl/oracle-free:23-slim
|
|
216
216
|
env:
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
217
|
+
ORACLE_PASSWORD: TestPassword123!
|
|
218
|
+
APP_USER: testuser
|
|
219
|
+
APP_USER_PASSWORD: TestPassword123!
|
|
220
220
|
ports:
|
|
221
|
-
-
|
|
221
|
+
- 1521:1521
|
|
222
222
|
options: >-
|
|
223
|
-
--health-cmd "
|
|
223
|
+
--health-cmd "healthcheck.sh"
|
|
224
224
|
--health-interval 10s
|
|
225
225
|
--health-timeout 5s
|
|
226
|
-
--health-retries
|
|
227
|
-
--health-start-period
|
|
226
|
+
--health-retries 20
|
|
227
|
+
--health-start-period 60s
|
|
228
228
|
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
steps:
|
|
230
|
+
- uses: actions/checkout@v4
|
|
231
|
+
|
|
232
|
+
- name: Set up Python 3.12
|
|
233
|
+
uses: actions/setup-python@v5
|
|
234
|
+
with:
|
|
235
|
+
python-version: "3.12"
|
|
236
|
+
|
|
237
|
+
- name: Install dependencies
|
|
238
|
+
run: |
|
|
239
|
+
python -m pip install --upgrade pip
|
|
240
|
+
pip install -e ".[test]"
|
|
241
|
+
pip install oracledb
|
|
242
|
+
|
|
243
|
+
- name: Run Oracle integration tests
|
|
231
244
|
env:
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
--health-interval 5s
|
|
240
|
-
--health-timeout 5s
|
|
241
|
-
--health-retries 10
|
|
242
|
-
--health-start-period 10s
|
|
245
|
+
ORACLE_HOST: localhost
|
|
246
|
+
ORACLE_PORT: 1521
|
|
247
|
+
ORACLE_USER: testuser
|
|
248
|
+
ORACLE_PASSWORD: TestPassword123!
|
|
249
|
+
ORACLE_SERVICE: FREEPDB1
|
|
250
|
+
run: |
|
|
251
|
+
pytest tests/test_oracle.py -v --timeout=120
|
|
243
252
|
|
|
244
|
-
|
|
245
|
-
|
|
253
|
+
test-mariadb:
|
|
254
|
+
runs-on: ubuntu-latest
|
|
255
|
+
needs: build
|
|
256
|
+
|
|
257
|
+
services:
|
|
258
|
+
mariadb:
|
|
259
|
+
image: mariadb:11
|
|
246
260
|
env:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
261
|
+
MARIADB_ROOT_PASSWORD: TestPassword123!
|
|
262
|
+
MARIADB_USER: testuser
|
|
263
|
+
MARIADB_PASSWORD: TestPassword123!
|
|
264
|
+
MARIADB_DATABASE: test_sqlit
|
|
251
265
|
ports:
|
|
252
|
-
-
|
|
266
|
+
- 3307:3306
|
|
253
267
|
options: >-
|
|
254
|
-
--health-cmd "
|
|
268
|
+
--health-cmd "healthcheck.sh --connect --innodb_initialized"
|
|
255
269
|
--health-interval 5s
|
|
256
270
|
--health-timeout 5s
|
|
257
271
|
--health-retries 10
|
|
@@ -265,45 +279,89 @@ jobs:
|
|
|
265
279
|
with:
|
|
266
280
|
python-version: "3.12"
|
|
267
281
|
|
|
268
|
-
- name: Install
|
|
282
|
+
- name: Install MariaDB Connector/C
|
|
269
283
|
run: |
|
|
270
|
-
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
|
|
271
|
-
curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
|
|
272
284
|
sudo apt-get update
|
|
273
|
-
sudo
|
|
285
|
+
sudo apt-get install -y libmariadb-dev
|
|
274
286
|
|
|
275
287
|
- name: Install dependencies
|
|
276
288
|
run: |
|
|
277
289
|
python -m pip install --upgrade pip
|
|
278
290
|
pip install -e ".[test]"
|
|
279
|
-
pip install
|
|
291
|
+
pip install mariadb
|
|
280
292
|
|
|
281
|
-
- name:
|
|
293
|
+
- name: Run MariaDB integration tests
|
|
294
|
+
env:
|
|
295
|
+
MARIADB_HOST: 127.0.0.1
|
|
296
|
+
MARIADB_PORT: 3307
|
|
297
|
+
MARIADB_USER: root
|
|
298
|
+
MARIADB_PASSWORD: TestPassword123!
|
|
299
|
+
MARIADB_DATABASE: test_sqlit
|
|
282
300
|
run: |
|
|
301
|
+
pytest tests/test_mariadb.py -v --timeout=120
|
|
302
|
+
|
|
303
|
+
test-duckdb:
|
|
304
|
+
runs-on: ubuntu-latest
|
|
305
|
+
strategy:
|
|
306
|
+
matrix:
|
|
307
|
+
python-version: ["3.10", "3.12"]
|
|
308
|
+
|
|
309
|
+
steps:
|
|
310
|
+
- uses: actions/checkout@v4
|
|
311
|
+
|
|
312
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
313
|
+
uses: actions/setup-python@v5
|
|
314
|
+
with:
|
|
315
|
+
python-version: ${{ matrix.python-version }}
|
|
316
|
+
|
|
317
|
+
- name: Install dependencies
|
|
318
|
+
run: |
|
|
319
|
+
python -m pip install --upgrade pip
|
|
320
|
+
pip install -e ".[test]"
|
|
321
|
+
pip install duckdb
|
|
322
|
+
|
|
323
|
+
- name: Run DuckDB integration tests
|
|
324
|
+
run: |
|
|
325
|
+
pytest tests/test_duckdb.py -v --timeout=60
|
|
326
|
+
|
|
327
|
+
test-cockroachdb:
|
|
328
|
+
runs-on: ubuntu-latest
|
|
329
|
+
needs: build
|
|
330
|
+
|
|
331
|
+
steps:
|
|
332
|
+
- uses: actions/checkout@v4
|
|
333
|
+
|
|
334
|
+
- name: Set up Python 3.12
|
|
335
|
+
uses: actions/setup-python@v5
|
|
336
|
+
with:
|
|
337
|
+
python-version: "3.12"
|
|
338
|
+
|
|
339
|
+
- name: Install dependencies
|
|
340
|
+
run: |
|
|
341
|
+
python -m pip install --upgrade pip
|
|
342
|
+
pip install -e ".[test]"
|
|
343
|
+
pip install psycopg2-binary
|
|
344
|
+
|
|
345
|
+
- name: Start CockroachDB
|
|
346
|
+
run: |
|
|
347
|
+
docker run -d --name cockroachdb \
|
|
348
|
+
-p 26257:26257 -p 8080:8080 \
|
|
349
|
+
cockroachdb/cockroach:latest start-single-node --insecure
|
|
283
350
|
for i in {1..30}; do
|
|
284
|
-
if
|
|
285
|
-
echo "
|
|
351
|
+
if curl -sf http://localhost:8080/health > /dev/null 2>&1; then
|
|
352
|
+
echo "CockroachDB is ready"
|
|
286
353
|
break
|
|
287
354
|
fi
|
|
288
|
-
echo "Waiting for
|
|
355
|
+
echo "Waiting for CockroachDB... ($i/30)"
|
|
289
356
|
sleep 2
|
|
290
357
|
done
|
|
291
358
|
|
|
292
|
-
- name: Run
|
|
359
|
+
- name: Run CockroachDB integration tests
|
|
293
360
|
env:
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
POSTGRES_PORT: 5432
|
|
300
|
-
POSTGRES_USER: testuser
|
|
301
|
-
POSTGRES_PASSWORD: TestPassword123!
|
|
302
|
-
POSTGRES_DATABASE: test_sqlit
|
|
303
|
-
MYSQL_HOST: localhost
|
|
304
|
-
MYSQL_PORT: 3306
|
|
305
|
-
MYSQL_USER: root
|
|
306
|
-
MYSQL_PASSWORD: TestPassword123!
|
|
307
|
-
MYSQL_DATABASE: test_sqlit
|
|
361
|
+
COCKROACHDB_HOST: localhost
|
|
362
|
+
COCKROACHDB_PORT: 26257
|
|
363
|
+
COCKROACHDB_USER: root
|
|
364
|
+
COCKROACHDB_PASSWORD: ""
|
|
365
|
+
COCKROACHDB_DATABASE: test_sqlit
|
|
308
366
|
run: |
|
|
309
|
-
pytest tests/ -v --timeout=120
|
|
367
|
+
pytest tests/test_cockroachdb.py -v --timeout=120
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thank you for considering a contribution to sqlit! This guide walks you through setting up your environment, running the test suite, and understanding the CI expectations.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
1. Clone the repository:
|
|
8
|
+
```bash
|
|
9
|
+
git clone https://github.com/Maxteabag/sqlit.git
|
|
10
|
+
cd sqlit
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. Install in development mode with test dependencies:
|
|
14
|
+
```bash
|
|
15
|
+
pip install -e ".[dev]"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Running Tests
|
|
19
|
+
|
|
20
|
+
### SQLite Tests (No Docker Required)
|
|
21
|
+
|
|
22
|
+
SQLite tests can run without any external dependencies:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pytest tests/ -v -k sqlite
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Full Test Suite (Requires Docker)
|
|
29
|
+
|
|
30
|
+
To run the complete test suite including SQL Server, PostgreSQL, MySQL, MariaDB, Oracle, DuckDB, and CockroachDB tests:
|
|
31
|
+
|
|
32
|
+
1. Start the test database containers:
|
|
33
|
+
```bash
|
|
34
|
+
docker compose -f docker-compose.test.yml up -d
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
2. Wait for the databases to be ready (about 30-45 seconds), then run tests:
|
|
38
|
+
```bash
|
|
39
|
+
pytest tests/ -v
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
You can leave the containers running between test runs - the test fixtures handle database setup/teardown automatically. Stop them when you're done developing:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
docker compose -f docker-compose.test.yml down
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Running Tests for Specific Databases
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pytest tests/ -v -k sqlite # SQLite only
|
|
52
|
+
pytest tests/ -v -k mssql # SQL Server only
|
|
53
|
+
pytest tests/ -v -k PostgreSQL # PostgreSQL only
|
|
54
|
+
pytest tests/ -v -k MySQL # MySQL only
|
|
55
|
+
pytest tests/ -v -k cockroach # CockroachDB only
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Environment Variables
|
|
59
|
+
|
|
60
|
+
The database tests can be configured with these environment variables:
|
|
61
|
+
|
|
62
|
+
**SQL Server:**
|
|
63
|
+
| Variable | Default | Description |
|
|
64
|
+
|----------|---------|-------------|
|
|
65
|
+
| `MSSQL_HOST` | `localhost` | SQL Server hostname |
|
|
66
|
+
| `MSSQL_PORT` | `1434` | SQL Server port |
|
|
67
|
+
| `MSSQL_USER` | `sa` | SQL Server username |
|
|
68
|
+
| `MSSQL_PASSWORD` | `TestPassword123!` | SQL Server password |
|
|
69
|
+
|
|
70
|
+
**PostgreSQL:**
|
|
71
|
+
| Variable | Default | Description |
|
|
72
|
+
|----------|---------|-------------|
|
|
73
|
+
| `POSTGRES_HOST` | `localhost` | PostgreSQL hostname |
|
|
74
|
+
| `POSTGRES_PORT` | `5432` | PostgreSQL port |
|
|
75
|
+
| `POSTGRES_USER` | `testuser` | PostgreSQL username |
|
|
76
|
+
| `POSTGRES_PASSWORD` | `TestPassword123!` | PostgreSQL password |
|
|
77
|
+
| `POSTGRES_DATABASE` | `test_sqlit` | PostgreSQL database |
|
|
78
|
+
|
|
79
|
+
**MySQL:**
|
|
80
|
+
| Variable | Default | Description |
|
|
81
|
+
|----------|---------|-------------|
|
|
82
|
+
| `MYSQL_HOST` | `localhost` | MySQL hostname |
|
|
83
|
+
| `MYSQL_PORT` | `3306` | MySQL port |
|
|
84
|
+
| `MYSQL_USER` | `root` | MySQL username |
|
|
85
|
+
| `MYSQL_PASSWORD` | `TestPassword123!` | MySQL password |
|
|
86
|
+
| `MYSQL_DATABASE` | `test_sqlit` | MySQL database |
|
|
87
|
+
|
|
88
|
+
**CockroachDB:**
|
|
89
|
+
| Variable | Default | Description |
|
|
90
|
+
|----------|---------|-------------|
|
|
91
|
+
| `COCKROACHDB_HOST` | `localhost` | CockroachDB hostname |
|
|
92
|
+
| `COCKROACHDB_PORT` | `26257` | CockroachDB port |
|
|
93
|
+
| `COCKROACHDB_USER` | `root` | CockroachDB username |
|
|
94
|
+
| `COCKROACHDB_PASSWORD` | `` | CockroachDB password (empty for the included Docker container) |
|
|
95
|
+
| `COCKROACHDB_DATABASE` | `test_sqlit` | CockroachDB database |
|
|
96
|
+
|
|
97
|
+
### CockroachDB Quickstart (Docker)
|
|
98
|
+
|
|
99
|
+
1. Start the included CockroachDB container:
|
|
100
|
+
```bash
|
|
101
|
+
docker compose -f docker-compose.test.yml up -d cockroachdb
|
|
102
|
+
```
|
|
103
|
+
2. Create a connection (default container runs insecure mode on port `26257` with `root` user):
|
|
104
|
+
```bash
|
|
105
|
+
sqlit connection create \
|
|
106
|
+
--name "LocalCockroach" \
|
|
107
|
+
--db-type cockroachdb \
|
|
108
|
+
--server "localhost" \
|
|
109
|
+
--port "26257" \
|
|
110
|
+
--database "defaultdb" \
|
|
111
|
+
--username "root"
|
|
112
|
+
```
|
|
113
|
+
3. Launch sqlit and connect:
|
|
114
|
+
```bash
|
|
115
|
+
sqlit
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## CI/CD
|
|
119
|
+
|
|
120
|
+
The project uses GitHub Actions for continuous integration:
|
|
121
|
+
|
|
122
|
+
- **Build**: Verifies the package builds on Python 3.10-3.13
|
|
123
|
+
- **SQLite Tests**: Runs SQLite integration tests (no external dependencies)
|
|
124
|
+
- **SQL Server Tests**: Runs SQL Server integration tests with Docker service
|
|
125
|
+
- **PostgreSQL Tests**: Runs PostgreSQL integration tests with Docker service
|
|
126
|
+
- **MySQL Tests**: Runs MySQL integration tests with Docker service
|
|
127
|
+
- **MariaDB/Oracle/DuckDB/CockroachDB Tests**: Runs the remaining database integration tests with Docker service where applicable
|
|
128
|
+
- **Full Test Suite**: Runs all tests across every supported database
|
|
129
|
+
|
|
130
|
+
Pull requests must pass all CI checks before merging.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlit-tui
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: A terminal UI for SQL Server, PostgreSQL, MySQL, and
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: A terminal UI for SQL Server, PostgreSQL, MySQL, SQLite, and Oracle
|
|
5
5
|
Project-URL: Homepage, https://github.com/Maxteabag/sqlit
|
|
6
6
|
Project-URL: Repository, https://github.com/Maxteabag/sqlit
|
|
7
7
|
Project-URL: Issues, https://github.com/Maxteabag/sqlit/issues
|
|
8
8
|
Author: Peter
|
|
9
9
|
License-Expression: MIT
|
|
10
10
|
License-File: LICENSE
|
|
11
|
-
Keywords: database,mssql,mysql,postgresql,server,sql,sqlite,terminal,tui
|
|
11
|
+
Keywords: database,mssql,mysql,oracle,postgresql,server,sql,sqlite,terminal,tui
|
|
12
12
|
Classifier: Development Status :: 4 - Beta
|
|
13
13
|
Classifier: Environment :: Console
|
|
14
14
|
Classifier: Intended Audience :: Developers
|
|
@@ -22,6 +22,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
22
22
|
Classifier: Topic :: Database
|
|
23
23
|
Requires-Python: >=3.10
|
|
24
24
|
Requires-Dist: pyodbc>=5.0.0
|
|
25
|
+
Requires-Dist: pyperclip>=1.8.2
|
|
25
26
|
Requires-Dist: textual[syntax]>=0.50.0
|
|
26
27
|
Provides-Extra: dev
|
|
27
28
|
Requires-Dist: build; extra == 'dev'
|
|
@@ -34,17 +35,21 @@ Description-Content-Type: text/markdown
|
|
|
34
35
|
|
|
35
36
|
# sqlit
|
|
36
37
|
|
|
37
|
-
A simple terminal UI for SQL Server, PostgreSQL, MySQL,
|
|
38
|
+
A simple terminal UI for SQL Server, PostgreSQL, MySQL, SQLite, and more—built for people who just want to run some queries fast.
|
|
38
39
|
|
|
39
40
|

|
|
40
41
|

|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
### Multi-database Support
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
### Query History
|
|
47
|
+

|
|
43
48
|
|
|
44
49
|
|
|
45
50
|
## Features
|
|
46
51
|
|
|
47
|
-
- **Multi-database support**: SQL Server, PostgreSQL, MySQL, and
|
|
52
|
+
- **Multi-database support**: SQL Server, PostgreSQL, MySQL, SQLite, MariaDB, Oracle, DuckDB, and CockroachDB
|
|
48
53
|
- **Query history**: Automatically saves queries per connection, searchable and sortable
|
|
49
54
|
- Fast and intuitive keyboard only control
|
|
50
55
|
- Context based help (no need to memorize tons of hot-keys)
|
|
@@ -69,7 +74,7 @@ The problem got severely worse when I switched to Linux and had to rely on VS CO
|
|
|
69
74
|
|
|
70
75
|
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.
|
|
71
76
|
|
|
72
|
-
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, and
|
|
77
|
+
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.
|
|
73
78
|
|
|
74
79
|
|
|
75
80
|
## Installation
|
|
@@ -80,10 +85,10 @@ pip install sqlit-tui
|
|
|
80
85
|
|
|
81
86
|
For SQL Server, sqlit will detect if you're missing ODBC drivers and help you install them.
|
|
82
87
|
|
|
83
|
-
For PostgreSQL and MySQL, install the optional drivers:
|
|
88
|
+
For PostgreSQL, CockroachDB, and MySQL, install the optional drivers:
|
|
84
89
|
|
|
85
90
|
```bash
|
|
86
|
-
# PostgreSQL
|
|
91
|
+
# PostgreSQL / CockroachDB
|
|
87
92
|
pip install psycopg2-binary
|
|
88
93
|
|
|
89
94
|
# MySQL
|
|
@@ -114,6 +119,7 @@ sqlit query -c "MyConnection" -f "script.sql" --format json
|
|
|
114
119
|
sqlit connection create --name "MySqlServer" --db-type mssql --server "localhost" --auth-type sql
|
|
115
120
|
sqlit connection create --name "MyPostgres" --db-type postgresql --server "localhost" --username "user" --password "pass"
|
|
116
121
|
sqlit connection create --name "MyMySQL" --db-type mysql --server "localhost" --username "user" --password "pass"
|
|
122
|
+
sqlit connection create --name "MyCockroach" --db-type cockroachdb --server "localhost" --port "26257" --database "defaultdb" --username "root"
|
|
117
123
|
sqlit connection create --name "MyLocalDB" --db-type sqlite --file-path "/path/to/database.db"
|
|
118
124
|
|
|
119
125
|
# Manage connections
|
|
@@ -146,100 +152,7 @@ Connections and settings are stored in `~/.sqlit/`.
|
|
|
146
152
|
|
|
147
153
|
## Contributing
|
|
148
154
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
1. Clone the repository:
|
|
152
|
-
```bash
|
|
153
|
-
git clone https://github.com/Maxteabag/sqlit.git
|
|
154
|
-
cd sqlit
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
2. Install in development mode with test dependencies:
|
|
158
|
-
```bash
|
|
159
|
-
pip install -e ".[dev]"
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Running Tests
|
|
163
|
-
|
|
164
|
-
#### SQLite Tests (No Docker Required)
|
|
165
|
-
|
|
166
|
-
SQLite tests can run without any external dependencies:
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
pytest tests/ -v -k sqlite
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
#### Full Test Suite (Requires Docker)
|
|
173
|
-
|
|
174
|
-
To run the complete test suite including SQL Server, PostgreSQL, and MySQL tests:
|
|
175
|
-
|
|
176
|
-
1. Start the test database containers:
|
|
177
|
-
```bash
|
|
178
|
-
docker compose -f docker-compose.test.yml up -d
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
2. Wait for the databases to be ready (about 30-45 seconds), then run tests:
|
|
182
|
-
```bash
|
|
183
|
-
pytest tests/ -v
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
You can leave the containers running between test runs - the test fixtures handle database setup/teardown automatically. Stop them when you're done developing:
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
docker compose -f docker-compose.test.yml down
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
#### Running Tests for Specific Databases
|
|
193
|
-
|
|
194
|
-
```bash
|
|
195
|
-
pytest tests/ -v -k sqlite # SQLite only
|
|
196
|
-
pytest tests/ -v -k mssql # SQL Server only
|
|
197
|
-
pytest tests/ -v -k PostgreSQL # PostgreSQL only
|
|
198
|
-
pytest tests/ -v -k MySQL # MySQL only
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
#### Environment Variables
|
|
202
|
-
|
|
203
|
-
The database tests can be configured with these environment variables:
|
|
204
|
-
|
|
205
|
-
**SQL Server:**
|
|
206
|
-
| Variable | Default | Description |
|
|
207
|
-
|----------|---------|-------------|
|
|
208
|
-
| `MSSQL_HOST` | `localhost` | SQL Server hostname |
|
|
209
|
-
| `MSSQL_PORT` | `1434` | SQL Server port |
|
|
210
|
-
| `MSSQL_USER` | `sa` | SQL Server username |
|
|
211
|
-
| `MSSQL_PASSWORD` | `TestPassword123!` | SQL Server password |
|
|
212
|
-
|
|
213
|
-
**PostgreSQL:**
|
|
214
|
-
| Variable | Default | Description |
|
|
215
|
-
|----------|---------|-------------|
|
|
216
|
-
| `POSTGRES_HOST` | `localhost` | PostgreSQL hostname |
|
|
217
|
-
| `POSTGRES_PORT` | `5432` | PostgreSQL port |
|
|
218
|
-
| `POSTGRES_USER` | `testuser` | PostgreSQL username |
|
|
219
|
-
| `POSTGRES_PASSWORD` | `TestPassword123!` | PostgreSQL password |
|
|
220
|
-
| `POSTGRES_DATABASE` | `test_sqlit` | PostgreSQL database |
|
|
221
|
-
|
|
222
|
-
**MySQL:**
|
|
223
|
-
| Variable | Default | Description |
|
|
224
|
-
|----------|---------|-------------|
|
|
225
|
-
| `MYSQL_HOST` | `localhost` | MySQL hostname |
|
|
226
|
-
| `MYSQL_PORT` | `3306` | MySQL port |
|
|
227
|
-
| `MYSQL_USER` | `root` | MySQL username |
|
|
228
|
-
| `MYSQL_PASSWORD` | `TestPassword123!` | MySQL password |
|
|
229
|
-
| `MYSQL_DATABASE` | `test_sqlit` | MySQL database |
|
|
230
|
-
|
|
231
|
-
### CI/CD
|
|
232
|
-
|
|
233
|
-
The project uses GitHub Actions for continuous integration:
|
|
234
|
-
|
|
235
|
-
- **Build**: Verifies the package builds on Python 3.10-3.13
|
|
236
|
-
- **SQLite Tests**: Runs SQLite integration tests (no external dependencies)
|
|
237
|
-
- **SQL Server Tests**: Runs SQL Server integration tests with Docker service
|
|
238
|
-
- **PostgreSQL Tests**: Runs PostgreSQL integration tests with Docker service
|
|
239
|
-
- **MySQL Tests**: Runs MySQL integration tests with Docker service
|
|
240
|
-
- **Full Test Suite**: Runs all tests with all four databases
|
|
241
|
-
|
|
242
|
-
Pull requests must pass all CI checks before merging.
|
|
155
|
+
See `CONTRIBUTING.md` for development setup, testing, CI, and CockroachDB quickstart steps.
|
|
243
156
|
|
|
244
157
|
## License
|
|
245
158
|
|