sqlit-tui 0.4.2__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.4.2/.github/workflows/ci.yml +450 -0
- sqlit_tui-0.4.2/.github/workflows/release.yml +64 -0
- sqlit_tui-0.4.2/.gitignore +28 -0
- sqlit_tui-0.4.2/CONTRIBUTING.md +130 -0
- sqlit_tui-0.4.2/LICENSE +21 -0
- sqlit_tui-0.4.2/PKG-INFO +166 -0
- sqlit_tui-0.4.2/README.md +129 -0
- sqlit_tui-0.4.2/demo-connect.gif +0 -0
- sqlit_tui-0.4.2/demo-history.gif +0 -0
- sqlit_tui-0.4.2/demo-providers.gif +0 -0
- sqlit_tui-0.4.2/demo-query.gif +0 -0
- sqlit_tui-0.4.2/docker-compose.test.yml +101 -0
- sqlit_tui-0.4.2/pyproject.toml +70 -0
- sqlit_tui-0.4.2/sqlit/__init__.py +15 -0
- sqlit_tui-0.4.2/sqlit/adapters.py +1312 -0
- sqlit_tui-0.4.2/sqlit/app.py +1887 -0
- sqlit_tui-0.4.2/sqlit/cli.py +150 -0
- sqlit_tui-0.4.2/sqlit/commands.py +334 -0
- sqlit_tui-0.4.2/sqlit/config.py +278 -0
- sqlit_tui-0.4.2/sqlit/drivers.py +177 -0
- sqlit_tui-0.4.2/sqlit/fields.py +103 -0
- sqlit_tui-0.4.2/sqlit/screens.py +1765 -0
- sqlit_tui-0.4.2/sqlit/widgets.py +209 -0
- sqlit_tui-0.4.2/tests/__init__.py +1 -0
- sqlit_tui-0.4.2/tests/conftest.py +1370 -0
- sqlit_tui-0.4.2/tests/test_cockroachdb.py +188 -0
- sqlit_tui-0.4.2/tests/test_duckdb.py +213 -0
- sqlit_tui-0.4.2/tests/test_mariadb.py +186 -0
- sqlit_tui-0.4.2/tests/test_mssql.py +186 -0
- sqlit_tui-0.4.2/tests/test_mysql.py +186 -0
- sqlit_tui-0.4.2/tests/test_oracle.py +188 -0
- sqlit_tui-0.4.2/tests/test_postgresql.py +186 -0
- sqlit_tui-0.4.2/tests/test_sqlite.py +204 -0
- sqlit_tui-0.4.2/tests/test_ssh.py +188 -0
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, master]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: |
|
|
26
|
+
python -m pip install --upgrade pip
|
|
27
|
+
pip install build
|
|
28
|
+
pip install -e .
|
|
29
|
+
|
|
30
|
+
- name: Check package builds
|
|
31
|
+
run: python -m build
|
|
32
|
+
|
|
33
|
+
- name: Verify CLI entry point
|
|
34
|
+
run: |
|
|
35
|
+
python -c "from sqlit.cli import main; print('CLI import OK')"
|
|
36
|
+
|
|
37
|
+
test-sqlite:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
strategy:
|
|
40
|
+
matrix:
|
|
41
|
+
python-version: ["3.10", "3.12"]
|
|
42
|
+
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v4
|
|
45
|
+
|
|
46
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
47
|
+
uses: actions/setup-python@v5
|
|
48
|
+
with:
|
|
49
|
+
python-version: ${{ matrix.python-version }}
|
|
50
|
+
|
|
51
|
+
- name: Install dependencies
|
|
52
|
+
run: |
|
|
53
|
+
python -m pip install --upgrade pip
|
|
54
|
+
pip install -e ".[test]"
|
|
55
|
+
|
|
56
|
+
- name: Run SQLite integration tests
|
|
57
|
+
run: |
|
|
58
|
+
pytest tests/test_sqlite.py -v --timeout=60
|
|
59
|
+
|
|
60
|
+
test-mssql:
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
needs: build
|
|
63
|
+
|
|
64
|
+
services:
|
|
65
|
+
mssql:
|
|
66
|
+
image: mcr.microsoft.com/mssql/server:2022-latest
|
|
67
|
+
env:
|
|
68
|
+
ACCEPT_EULA: Y
|
|
69
|
+
MSSQL_SA_PASSWORD: TestPassword123!
|
|
70
|
+
MSSQL_PID: Developer
|
|
71
|
+
ports:
|
|
72
|
+
- 1433:1433
|
|
73
|
+
options: >-
|
|
74
|
+
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'TestPassword123!' -C -Q 'SELECT 1' || exit 1"
|
|
75
|
+
--health-interval 10s
|
|
76
|
+
--health-timeout 5s
|
|
77
|
+
--health-retries 10
|
|
78
|
+
--health-start-period 30s
|
|
79
|
+
|
|
80
|
+
steps:
|
|
81
|
+
- uses: actions/checkout@v4
|
|
82
|
+
|
|
83
|
+
- name: Set up Python 3.12
|
|
84
|
+
uses: actions/setup-python@v5
|
|
85
|
+
with:
|
|
86
|
+
python-version: "3.12"
|
|
87
|
+
|
|
88
|
+
- name: Install ODBC driver
|
|
89
|
+
run: |
|
|
90
|
+
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
|
|
91
|
+
curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
|
|
92
|
+
sudo apt-get update
|
|
93
|
+
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev
|
|
94
|
+
|
|
95
|
+
- name: Install dependencies
|
|
96
|
+
run: |
|
|
97
|
+
python -m pip install --upgrade pip
|
|
98
|
+
pip install -e ".[test]"
|
|
99
|
+
|
|
100
|
+
- name: Wait for SQL Server to be ready
|
|
101
|
+
run: |
|
|
102
|
+
for i in {1..30}; do
|
|
103
|
+
if /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'TestPassword123!' -C -Q "SELECT 1" &> /dev/null; then
|
|
104
|
+
echo "SQL Server is ready"
|
|
105
|
+
break
|
|
106
|
+
fi
|
|
107
|
+
echo "Waiting for SQL Server... ($i/30)"
|
|
108
|
+
sleep 2
|
|
109
|
+
done
|
|
110
|
+
|
|
111
|
+
- name: Run SQL Server integration tests
|
|
112
|
+
env:
|
|
113
|
+
MSSQL_HOST: localhost
|
|
114
|
+
MSSQL_PORT: 1433
|
|
115
|
+
MSSQL_USER: sa
|
|
116
|
+
MSSQL_PASSWORD: TestPassword123!
|
|
117
|
+
run: |
|
|
118
|
+
pytest tests/test_mssql.py -v --timeout=120
|
|
119
|
+
|
|
120
|
+
test-postgresql:
|
|
121
|
+
runs-on: ubuntu-latest
|
|
122
|
+
needs: build
|
|
123
|
+
|
|
124
|
+
services:
|
|
125
|
+
postgres:
|
|
126
|
+
image: postgres:16-alpine
|
|
127
|
+
env:
|
|
128
|
+
POSTGRES_USER: testuser
|
|
129
|
+
POSTGRES_PASSWORD: TestPassword123!
|
|
130
|
+
POSTGRES_DB: test_sqlit
|
|
131
|
+
ports:
|
|
132
|
+
- 5432:5432
|
|
133
|
+
options: >-
|
|
134
|
+
--health-cmd "pg_isready -U testuser -d test_sqlit"
|
|
135
|
+
--health-interval 5s
|
|
136
|
+
--health-timeout 5s
|
|
137
|
+
--health-retries 10
|
|
138
|
+
--health-start-period 10s
|
|
139
|
+
|
|
140
|
+
steps:
|
|
141
|
+
- uses: actions/checkout@v4
|
|
142
|
+
|
|
143
|
+
- name: Set up Python 3.12
|
|
144
|
+
uses: actions/setup-python@v5
|
|
145
|
+
with:
|
|
146
|
+
python-version: "3.12"
|
|
147
|
+
|
|
148
|
+
- name: Install dependencies
|
|
149
|
+
run: |
|
|
150
|
+
python -m pip install --upgrade pip
|
|
151
|
+
pip install -e ".[test]"
|
|
152
|
+
pip install psycopg2-binary
|
|
153
|
+
|
|
154
|
+
- name: Run PostgreSQL integration tests
|
|
155
|
+
env:
|
|
156
|
+
POSTGRES_HOST: localhost
|
|
157
|
+
POSTGRES_PORT: 5432
|
|
158
|
+
POSTGRES_USER: testuser
|
|
159
|
+
POSTGRES_PASSWORD: TestPassword123!
|
|
160
|
+
POSTGRES_DATABASE: test_sqlit
|
|
161
|
+
run: |
|
|
162
|
+
pytest tests/test_postgresql.py -v --timeout=120
|
|
163
|
+
|
|
164
|
+
test-mysql:
|
|
165
|
+
runs-on: ubuntu-latest
|
|
166
|
+
needs: build
|
|
167
|
+
|
|
168
|
+
services:
|
|
169
|
+
mysql:
|
|
170
|
+
image: mysql:8.0
|
|
171
|
+
env:
|
|
172
|
+
MYSQL_ROOT_PASSWORD: TestPassword123!
|
|
173
|
+
MYSQL_USER: testuser
|
|
174
|
+
MYSQL_PASSWORD: TestPassword123!
|
|
175
|
+
MYSQL_DATABASE: test_sqlit
|
|
176
|
+
ports:
|
|
177
|
+
- 3306:3306
|
|
178
|
+
options: >-
|
|
179
|
+
--health-cmd "mysqladmin ping -h localhost -u testuser -pTestPassword123!"
|
|
180
|
+
--health-interval 5s
|
|
181
|
+
--health-timeout 5s
|
|
182
|
+
--health-retries 10
|
|
183
|
+
--health-start-period 30s
|
|
184
|
+
|
|
185
|
+
steps:
|
|
186
|
+
- uses: actions/checkout@v4
|
|
187
|
+
|
|
188
|
+
- name: Set up Python 3.12
|
|
189
|
+
uses: actions/setup-python@v5
|
|
190
|
+
with:
|
|
191
|
+
python-version: "3.12"
|
|
192
|
+
|
|
193
|
+
- name: Install dependencies
|
|
194
|
+
run: |
|
|
195
|
+
python -m pip install --upgrade pip
|
|
196
|
+
pip install -e ".[test]"
|
|
197
|
+
pip install mysql-connector-python
|
|
198
|
+
|
|
199
|
+
- name: Run MySQL integration tests
|
|
200
|
+
env:
|
|
201
|
+
MYSQL_HOST: localhost
|
|
202
|
+
MYSQL_PORT: 3306
|
|
203
|
+
MYSQL_USER: root
|
|
204
|
+
MYSQL_PASSWORD: TestPassword123!
|
|
205
|
+
MYSQL_DATABASE: test_sqlit
|
|
206
|
+
run: |
|
|
207
|
+
pytest tests/test_mysql.py -v --timeout=120
|
|
208
|
+
|
|
209
|
+
test-oracle:
|
|
210
|
+
runs-on: ubuntu-latest
|
|
211
|
+
needs: build
|
|
212
|
+
|
|
213
|
+
services:
|
|
214
|
+
oracle:
|
|
215
|
+
image: gvenzl/oracle-free:23-slim
|
|
216
|
+
env:
|
|
217
|
+
ORACLE_PASSWORD: TestPassword123!
|
|
218
|
+
APP_USER: testuser
|
|
219
|
+
APP_USER_PASSWORD: TestPassword123!
|
|
220
|
+
ports:
|
|
221
|
+
- 1521:1521
|
|
222
|
+
options: >-
|
|
223
|
+
--health-cmd "healthcheck.sh"
|
|
224
|
+
--health-interval 10s
|
|
225
|
+
--health-timeout 5s
|
|
226
|
+
--health-retries 20
|
|
227
|
+
--health-start-period 60s
|
|
228
|
+
|
|
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
|
|
244
|
+
env:
|
|
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
|
|
252
|
+
|
|
253
|
+
test-mariadb:
|
|
254
|
+
runs-on: ubuntu-latest
|
|
255
|
+
needs: build
|
|
256
|
+
|
|
257
|
+
services:
|
|
258
|
+
mariadb:
|
|
259
|
+
image: mariadb:11
|
|
260
|
+
env:
|
|
261
|
+
MARIADB_ROOT_PASSWORD: TestPassword123!
|
|
262
|
+
MARIADB_USER: testuser
|
|
263
|
+
MARIADB_PASSWORD: TestPassword123!
|
|
264
|
+
MARIADB_DATABASE: test_sqlit
|
|
265
|
+
ports:
|
|
266
|
+
- 3307:3306
|
|
267
|
+
options: >-
|
|
268
|
+
--health-cmd "healthcheck.sh --connect --innodb_initialized"
|
|
269
|
+
--health-interval 5s
|
|
270
|
+
--health-timeout 5s
|
|
271
|
+
--health-retries 10
|
|
272
|
+
--health-start-period 30s
|
|
273
|
+
|
|
274
|
+
steps:
|
|
275
|
+
- uses: actions/checkout@v4
|
|
276
|
+
|
|
277
|
+
- name: Set up Python 3.12
|
|
278
|
+
uses: actions/setup-python@v5
|
|
279
|
+
with:
|
|
280
|
+
python-version: "3.12"
|
|
281
|
+
|
|
282
|
+
- name: Install MariaDB Connector/C
|
|
283
|
+
run: |
|
|
284
|
+
sudo apt-get update
|
|
285
|
+
sudo apt-get install -y libmariadb-dev
|
|
286
|
+
|
|
287
|
+
- name: Install dependencies
|
|
288
|
+
run: |
|
|
289
|
+
python -m pip install --upgrade pip
|
|
290
|
+
pip install -e ".[test]"
|
|
291
|
+
pip install mariadb
|
|
292
|
+
|
|
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
|
|
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
|
|
350
|
+
for i in {1..30}; do
|
|
351
|
+
if curl -sf http://localhost:8080/health > /dev/null 2>&1; then
|
|
352
|
+
echo "CockroachDB is ready"
|
|
353
|
+
break
|
|
354
|
+
fi
|
|
355
|
+
echo "Waiting for CockroachDB... ($i/30)"
|
|
356
|
+
sleep 2
|
|
357
|
+
done
|
|
358
|
+
|
|
359
|
+
- name: Run CockroachDB integration tests
|
|
360
|
+
env:
|
|
361
|
+
COCKROACHDB_HOST: localhost
|
|
362
|
+
COCKROACHDB_PORT: 26257
|
|
363
|
+
COCKROACHDB_USER: root
|
|
364
|
+
COCKROACHDB_PASSWORD: ""
|
|
365
|
+
COCKROACHDB_DATABASE: test_sqlit
|
|
366
|
+
run: |
|
|
367
|
+
pytest tests/test_cockroachdb.py -v --timeout=120
|
|
368
|
+
|
|
369
|
+
test-ssh:
|
|
370
|
+
runs-on: ubuntu-latest
|
|
371
|
+
needs: build
|
|
372
|
+
|
|
373
|
+
steps:
|
|
374
|
+
- uses: actions/checkout@v4
|
|
375
|
+
|
|
376
|
+
- name: Set up Python 3.12
|
|
377
|
+
uses: actions/setup-python@v5
|
|
378
|
+
with:
|
|
379
|
+
python-version: "3.12"
|
|
380
|
+
|
|
381
|
+
- name: Install dependencies
|
|
382
|
+
run: |
|
|
383
|
+
python -m pip install --upgrade pip
|
|
384
|
+
pip install -e ".[test]"
|
|
385
|
+
pip install psycopg2-binary
|
|
386
|
+
|
|
387
|
+
- name: Create Docker network
|
|
388
|
+
run: docker network create ssh-test-net
|
|
389
|
+
|
|
390
|
+
- name: Start PostgreSQL
|
|
391
|
+
run: |
|
|
392
|
+
docker run -d --name postgres --network ssh-test-net \
|
|
393
|
+
-e POSTGRES_USER=testuser \
|
|
394
|
+
-e POSTGRES_PASSWORD=TestPassword123! \
|
|
395
|
+
-e POSTGRES_DB=test_sqlit \
|
|
396
|
+
-p 5433:5432 \
|
|
397
|
+
postgres:16-alpine
|
|
398
|
+
# Wait for PostgreSQL to be ready
|
|
399
|
+
for i in {1..30}; do
|
|
400
|
+
if docker exec postgres pg_isready -U testuser -d test_sqlit > /dev/null 2>&1; then
|
|
401
|
+
echo "PostgreSQL is ready"
|
|
402
|
+
break
|
|
403
|
+
fi
|
|
404
|
+
echo "Waiting for PostgreSQL... ($i/30)"
|
|
405
|
+
sleep 2
|
|
406
|
+
done
|
|
407
|
+
|
|
408
|
+
- name: Start SSH server
|
|
409
|
+
run: |
|
|
410
|
+
docker run -d --name sshserver --network ssh-test-net \
|
|
411
|
+
-e PUID=1000 \
|
|
412
|
+
-e PGID=1000 \
|
|
413
|
+
-e USER_NAME=testuser \
|
|
414
|
+
-e USER_PASSWORD=testpass \
|
|
415
|
+
-e PASSWORD_ACCESS=true \
|
|
416
|
+
-e DOCKER_MODS=linuxserver/mods:openssh-server-ssh-tunnel \
|
|
417
|
+
-p 2222:2222 \
|
|
418
|
+
lscr.io/linuxserver/openssh-server:latest
|
|
419
|
+
# Wait for SSH to be ready
|
|
420
|
+
for i in {1..30}; do
|
|
421
|
+
if nc -z localhost 2222 2>/dev/null; then
|
|
422
|
+
echo "SSH server is ready"
|
|
423
|
+
break
|
|
424
|
+
fi
|
|
425
|
+
echo "Waiting for SSH server... ($i/30)"
|
|
426
|
+
sleep 2
|
|
427
|
+
done
|
|
428
|
+
|
|
429
|
+
- name: Run SSH tunnel integration tests
|
|
430
|
+
env:
|
|
431
|
+
SSH_HOST: localhost
|
|
432
|
+
SSH_PORT: 2222
|
|
433
|
+
SSH_USER: testuser
|
|
434
|
+
SSH_PASSWORD: testpass
|
|
435
|
+
SSH_REMOTE_DB_HOST: postgres
|
|
436
|
+
SSH_REMOTE_DB_PORT: 5432
|
|
437
|
+
SSH_DIRECT_PG_HOST: localhost
|
|
438
|
+
SSH_DIRECT_PG_PORT: 5433
|
|
439
|
+
POSTGRES_USER: testuser
|
|
440
|
+
POSTGRES_PASSWORD: TestPassword123!
|
|
441
|
+
POSTGRES_DATABASE: test_sqlit
|
|
442
|
+
run: |
|
|
443
|
+
pytest tests/test_ssh.py -v --timeout=120
|
|
444
|
+
|
|
445
|
+
- name: Cleanup
|
|
446
|
+
if: always()
|
|
447
|
+
run: |
|
|
448
|
+
docker stop sshserver postgres || true
|
|
449
|
+
docker rm sshserver postgres || true
|
|
450
|
+
docker network rm ssh-test-net || true
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Release and Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
release:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Extract version from tag
|
|
17
|
+
id: version
|
|
18
|
+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
19
|
+
|
|
20
|
+
- name: Create GitHub Release
|
|
21
|
+
uses: softprops/action-gh-release@v1
|
|
22
|
+
with:
|
|
23
|
+
name: ${{ steps.version.outputs.VERSION }}
|
|
24
|
+
generate_release_notes: true
|
|
25
|
+
draft: false
|
|
26
|
+
prerelease: false
|
|
27
|
+
|
|
28
|
+
build:
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
|
|
33
|
+
- name: Set up Python
|
|
34
|
+
uses: actions/setup-python@v5
|
|
35
|
+
with:
|
|
36
|
+
python-version: "3.12"
|
|
37
|
+
|
|
38
|
+
- name: Install build tools
|
|
39
|
+
run: python -m pip install --upgrade build
|
|
40
|
+
|
|
41
|
+
- name: Build package
|
|
42
|
+
run: python -m build
|
|
43
|
+
|
|
44
|
+
- name: Upload dist artifacts
|
|
45
|
+
uses: actions/upload-artifact@v4
|
|
46
|
+
with:
|
|
47
|
+
name: dist
|
|
48
|
+
path: dist/
|
|
49
|
+
|
|
50
|
+
publish:
|
|
51
|
+
needs: build
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
environment: pypi
|
|
54
|
+
permissions:
|
|
55
|
+
id-token: write
|
|
56
|
+
steps:
|
|
57
|
+
- name: Download dist artifacts
|
|
58
|
+
uses: actions/download-artifact@v4
|
|
59
|
+
with:
|
|
60
|
+
name: dist
|
|
61
|
+
path: dist/
|
|
62
|
+
|
|
63
|
+
- name: Publish to PyPI
|
|
64
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
*.egg
|
|
11
|
+
|
|
12
|
+
# Virtual environments
|
|
13
|
+
venv/
|
|
14
|
+
.venv/
|
|
15
|
+
|
|
16
|
+
# IDE
|
|
17
|
+
.idea/
|
|
18
|
+
.vscode/
|
|
19
|
+
*.swp
|
|
20
|
+
*.swo
|
|
21
|
+
|
|
22
|
+
# OS
|
|
23
|
+
.DS_Store
|
|
24
|
+
|
|
25
|
+
# Demo files
|
|
26
|
+
docker-compose.yml
|
|
27
|
+
init.sql
|
|
28
|
+
*.tape
|
|
@@ -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.
|
sqlit_tui-0.4.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Peter
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|