Skip to content

Commit d962502

Browse files
authored
Merge branch 'main' into fix/packaging
2 parents 6672a83 + 8f9bf98 commit d962502

File tree

691 files changed

+69217
-23431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

691 files changed

+69217
-23431
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ jobs:
3333
- name: Verify CLI entry point
3434
run: uv run python -c "from sqlit.cli import main; print('CLI import OK')"
3535

36+
nix-flake:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Install Nix
42+
uses: cachix/install-nix-action@v26
43+
44+
- name: Build flake package
45+
run: nix build .#sqlit
46+
3647
test-unit:
3748
runs-on: ubuntu-latest
3849
strategy:

.github/workflows/release.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,14 @@ jobs:
7474
steps:
7575
- uses: actions/checkout@v6
7676

77-
- name: Extract version
78-
id: version
77+
- name: Download dist artifacts
78+
uses: actions/download-artifact@v4
79+
with:
80+
name: dist
81+
path: dist/
82+
83+
- name: Extract version and checksum
84+
id: info
7985
run: |
8086
if [ -n "${{ github.event.inputs.version }}" ]; then
8187
echo "VERSION=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
@@ -110,8 +116,8 @@ jobs:
110116
111117
- name: Update PKGBUILD
112118
run: |
113-
VERSION=${{ steps.version.outputs.VERSION }}
114-
CHECKSUM=${{ steps.pypi.outputs.CHECKSUM }}
119+
VERSION=${{ steps.info.outputs.VERSION }}
120+
CHECKSUM=${{ steps.info.outputs.CHECKSUM }}
115121
116122
cd aur
117123
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" PKGBUILD
@@ -121,9 +127,9 @@ jobs:
121127
- name: Publish to AUR
122128
uses: KSXGitHub/github-actions-deploy-aur@v4
123129
with:
124-
pkgname: python-sqlit-tui
130+
pkgname: sqlit
125131
pkgbuild: ./aur/PKGBUILD
126132
commit_username: Peter
127133
commit_email: [email protected]
128134
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
129-
commit_message: "Update to v${{ steps.version.outputs.VERSION }}"
135+
commit_message: "Update to v${{ steps.info.outputs.VERSION }}"

.gitignore

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,26 @@ venv/
1818
.vscode/
1919
*.swp
2020
*.swo
21+
.claude/
2122

2223
# Local caches
2324
.cache/
25+
.benchmarks/
26+
.mypy_cache/
27+
.pytest_cache/
2428
.ruff_cache/
2529
.sqlit/
30+
.sqlit-config/
2631

2732
# OS
2833
.DS_Store
2934

3035
# Demo files
31-
docker-compose.yml
32-
init.sql
3336
*.tape
3437
.tmp/
35-
demos/drafts/
38+
docs/demos/drafts/
39+
infra/docker/docker-compose.yml
40+
infra/sql/init.sql
3641

3742
# Database files
3843
*.db
@@ -63,4 +68,5 @@ tests/.env
6368

6469
# Test artifacts
6570
tests/integration/drivers/artifacts/
71+
tests/integration/drivers/
6672
__pycache__/

CONTRIBUTING.md

Lines changed: 82 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,21 @@ Thank you for considering a contribution to sqlit! This guide walks you through
1515
pip install -e ".[dev]"
1616
```
1717

18+
For the full integration suite (all database drivers):
19+
```bash
20+
pip install -e ".[dev,all]"
21+
```
22+
1823
## Running Tests
1924

25+
### CLI E2E Tests
26+
27+
CLI end-to-end tests run the entrypoint in a subprocess:
28+
29+
```bash
30+
pytest tests/cli/ -v
31+
```
32+
2033
### SQLite Tests (No Docker Required)
2134

2235
SQLite tests can run without any external dependencies:
@@ -27,33 +40,43 @@ pytest tests/ -v -k sqlite
2740

2841
### Full Test Suite (Requires Docker)
2942

30-
To run the complete test suite including SQL Server, PostgreSQL, MySQL, MariaDB, FirebirdSQL, Oracle, DuckDB, and CockroachDB tests:
43+
To run the complete test suite including SQL Server, PostgreSQL, MySQL, MariaDB, FirebirdSQL, Oracle, ClickHouse, Turso (libsql), D1 (miniflare), SSH tunnel, DuckDB, CockroachDB, and Flight SQL tests:
3144

3245
1. Start the test database containers:
3346
```bash
34-
docker compose -f docker-compose.test.yml up -d
47+
docker compose -f infra/docker/docker-compose.test.yml up -d
48+
```
49+
To include the enterprise test containers (Db2, Trino, Presto, Oracle 11g):
50+
```bash
51+
docker compose -f infra/docker/docker-compose.test.yml --profile enterprise up -d
3552
```
3653

3754
2. Wait for the databases to be ready (about 30-45 seconds), then run tests:
3855
```bash
3956
pytest tests/ -v
4057
```
4158

59+
To include Docker detection tests that spin up temporary containers:
60+
```bash
61+
pytest tests/integration/docker_detect/ -v --run-docker-container
62+
```
63+
4264
You can leave the containers running between test runs - the test fixtures handle database setup/teardown automatically. Stop them when you're done developing:
4365

4466
```bash
45-
docker compose -f docker-compose.test.yml down
67+
docker compose -f infra/docker/docker-compose.test.yml down
4668
```
4769

4870
### Running Tests for Specific Databases
4971

5072
```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-
pytest tests/ -v -k firebird # FirebirdSQL only
73+
pytest tests/ -v -k sqlite
74+
pytest tests/ -v -k mssql
75+
pytest tests/ -v -k PostgreSQL
76+
pytest tests/ -v -k MySQL
77+
pytest tests/ -v -k cockroach
78+
pytest tests/ -v -k firebird
79+
pytest tests/ -v -k flight
5780
```
5881

5982
### Environment Variables
@@ -110,35 +133,57 @@ The database tests can be configured with these environment variables:
110133
| `AWS_PROFILE` | `default` | AWS CLI profile to use (must be configured in `~/.aws/credentials`) |
111134
| `AWS_REGION` | `us-east-1` | AWS Region |
112135

113-
### CockroachDB Quickstart (Docker)
114-
115-
1. Start the included CockroachDB container:
116-
```bash
117-
docker compose -f docker-compose.test.yml up -d cockroachdb
118-
```
119-
2. Create a connection (default container runs insecure mode on port `26257` with `root` user):
120-
```bash
121-
sqlit connection create \
122-
--name "LocalCockroach" \
123-
--db-type cockroachdb \
124-
--server "localhost" \
125-
--port "26257" \
126-
--database "defaultdb" \
127-
--username "root"
128-
```
129-
3. Launch sqlit and connect:
130-
```bash
131-
sqlit
132-
```
133-
134-
## CI/CD
135-
136-
The project uses GitHub Actions for continuous integration:
136+
**IBM Db2:**
137+
| Variable | Default | Description |
138+
|----------|---------|-------------|
139+
| `DB2_HOST` | `localhost` | Db2 hostname |
140+
| `DB2_PORT` | `50000` | Db2 port |
141+
| `DB2_USER` | `db2inst1` | Db2 username |
142+
| `DB2_PASSWORD` | `TestPassword123!` | Db2 password |
143+
| `DB2_DATABASE` | `testdb` | Db2 database name |
137144

138-
- **Build**: Verifies the package builds on Python 3.10-3.13
139-
- **SQLite Tests**: Runs SQLite integration tests (no external dependencies)
140-
- **SQL Server Tests**: Runs SQL Server integration tests with Docker service
141-
-
145+
**Trino:**
146+
| Variable | Default | Description |
147+
|----------|---------|-------------|
148+
| `TRINO_HOST` | `localhost` | Trino hostname |
149+
| `TRINO_PORT` | `8082` | Trino port |
150+
| `TRINO_USER` | `testuser` | Trino username |
151+
| `TRINO_PASSWORD` | `` | Trino password |
152+
| `TRINO_CATALOG` | `memory` | Trino catalog |
153+
| `TRINO_SCHEMA` | `default` | Trino schema |
154+
| `TRINO_HTTP_SCHEME` | `http` | Trino HTTP scheme |
155+
156+
**Presto:**
157+
| Variable | Default | Description |
158+
|----------|---------|-------------|
159+
| `PRESTO_HOST` | `localhost` | Presto hostname |
160+
| `PRESTO_PORT` | `8083` | Presto port |
161+
| `PRESTO_USER` | `testuser` | Presto username |
162+
| `PRESTO_PASSWORD` | `` | Presto password |
163+
| `PRESTO_CATALOG` | `memory` | Presto catalog |
164+
| `PRESTO_SCHEMA` | `default` | Presto schema |
165+
| `PRESTO_HTTP_SCHEME` | `http` | Presto HTTP scheme |
166+
167+
**Oracle 11g (Legacy):**
168+
| Variable | Default | Description |
169+
|----------|---------|-------------|
170+
| `ORACLE11G_RUN_TESTS` | `` | Enable Oracle 11g tests when set to `1` |
171+
| `ORACLE11G_HOST` | `localhost` | Oracle 11g hostname |
172+
| `ORACLE11G_PORT` | `1522` | Oracle 11g port |
173+
| `ORACLE11G_USER` | `system` | Oracle 11g username |
174+
| `ORACLE11G_PASSWORD` | `oracle` | Oracle 11g password |
175+
| `ORACLE11G_SERVICE` | `XE` | Oracle 11g service name |
176+
| `ORACLE11G_CLIENT_MODE` | `thick` | Oracle client mode |
177+
| `ORACLE11G_CLIENT_LIB_DIR` | `` | Oracle Instant Client library directory |
178+
179+
**Flight SQL:**
180+
| Variable | Default | Description |
181+
|----------|---------|-------------|
182+
| `FLIGHT_HOST` | `localhost` | Flight SQL server hostname |
183+
| `FLIGHT_PORT` | `31337` | Flight SQL server port |
184+
| `FLIGHT_USER` | `` | Flight SQL username (optional) |
185+
| `FLIGHT_PASSWORD` | `` | Flight SQL password (optional) |
186+
| `FLIGHT_DATABASE` | `` | Flight SQL database/catalog (optional) |
142187

143188
### Vision
144189

@@ -217,11 +262,3 @@ sqlit should provide fun and a feeling of mastery and satisfaction for those who
217262
**Example:**
218263
<e> = explorer pane, <q> = query pane, <r> = results pane.
219264
Rationale: E;Q;R satisfies both intuitiveness (each binding is the first letter of the pane), harmony (proximity: qwerty speaks for itself)
220-
221-
- **PostgreSQL Tests**: Runs PostgreSQL integration tests with Docker service
222-
- **MySQL Tests**: Runs MySQL integration tests with Docker service
223-
- **Firebird Tests**: Runs Firebird integration tests with Docker service
224-
- **MariaDB/Oracle/DuckDB/CockroachDB Tests**: Runs the remaining database integration tests with Docker service where applicable
225-
- **Full Test Suite**: Runs all tests across every supported database
226-
227-
Pull requests must pass all CI checks before merging.

0 commit comments

Comments
 (0)