Skip to content

Commit bd07279

Browse files
authored
Remove ggsql REST binary (#286)
1 parent 6ddab63 commit bd07279

6 files changed

Lines changed: 26 additions & 949 deletions

File tree

CLAUDE.md

Lines changed: 6 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -643,81 +643,6 @@ impl Writer for VegaLiteWriter {
643643

644644
---
645645

646-
### 4. REST API (`src/rest.rs`)
647-
648-
**Responsibility**: HTTP interface for executing ggsql queries.
649-
650-
**Technology**: Axum web framework with CORS support
651-
652-
**Endpoints**:
653-
654-
```rust
655-
// POST /api/v1/query - Execute ggsql query
656-
// Request:
657-
{
658-
"query": "SELECT ... VISUALISE ...",
659-
"reader": "duckdb://memory", // optional, default
660-
"writer": "vegalite" // optional, default
661-
}
662-
663-
// Response (success):
664-
{
665-
"status": "success",
666-
"data": {
667-
"spec": { /* Vega-Lite JSON */ },
668-
"metadata": {
669-
"rows": 100,
670-
"columns": ["date", "revenue", "region", "..."],
671-
"global_mapping": "Mappings",
672-
"layers": 2
673-
}
674-
}
675-
}
676-
677-
// Response (error):
678-
{
679-
"status": "error",
680-
"error": {
681-
"type": "ParseError",
682-
"message": "..."
683-
}
684-
}
685-
```
686-
687-
**Additional Endpoints**:
688-
689-
- `GET /` - Root endpoint (returns API information and status)
690-
- `POST /api/v1/parse` - Parse query and return AST (debugging)
691-
- `GET /api/v1/health` - Health check
692-
- `GET /api/v1/version` - Version info
693-
694-
**CORS Configuration**: Allows cross-origin requests for web frontends
695-
696-
**CLI Options**:
697-
698-
```bash
699-
# Basic usage
700-
ggsql-rest --host 127.0.0.1 --port 3334
701-
702-
# With sample data (pre-loaded products, sales, employees tables)
703-
ggsql-rest --load-sample-data
704-
705-
# Load custom data files (CSV, Parquet, JSON)
706-
ggsql-rest --load-data data.csv --load-data other.parquet
707-
708-
# Configure CORS origins
709-
ggsql-rest --cors-origin "http://localhost:5173,http://localhost:3000"
710-
```
711-
712-
**Sample Data Loading**:
713-
714-
- `--load-sample-data`: Loads built-in sample data (products, sales, employees)
715-
- `--load-data <file>`: Loads data from CSV, Parquet, or JSON files into in-memory database
716-
- Multiple `--load-data` flags can be used to load multiple files
717-
- Pre-loaded data persists for the lifetime of the server session
718-
719-
---
720-
721646
### 5. CLI (`src/cli.rs`)
722647

723648
**Responsibility**: Command-line interface for local query execution.
@@ -1059,12 +984,6 @@ ggsql uses Cargo feature flags to enable optional functionality and reduce binar
1059984
- `plotters` - Enable plotters-based rendering (planned, not implemented)
1060985
- `all-writers` - Enable all writer implementations
1061986

1062-
**API features**:
1063-
1064-
- `rest-api` - Enable REST API server (`ggsql-rest` binary)
1065-
- Includes: `axum`, `tokio`, `tower-http`, `tracing`, `duckdb`, `vegalite`
1066-
- Required for building `ggsql-rest` server
1067-
1068987
**Python bindings**:
1069988

1070989
- `ggsql-python` - Python bindings via PyO3 (separate crate, not a feature flag)
@@ -1078,9 +997,6 @@ cargo build --no-default-features
1078997
# With specific features
1079998
cargo build --features "duckdb,vegalite"
1080999

1081-
# REST API server
1082-
cargo build --bin ggsql-rest --features rest-api
1083-
10841000
# All features
10851001
cargo build --all-features
10861002
```
@@ -1092,7 +1008,6 @@ cargo build --all-features
10921008
- `duckdb``duckdb` crate
10931009
- `postgres``postgres` crate (future)
10941010
- `sqlite``rusqlite` crate (future)
1095-
- `rest-api``axum`, `tokio`, `tower-http`, `tracing`, `tracing-subscriber`
10961011
- `ggsql-python``pyo3`, `narwhals`, `altair` (separate workspace crate)
10971012

10981013
---
@@ -1112,7 +1027,6 @@ ggsql uses [cargo-packager](https://github.com/crabnebula-dev/cargo-packager) to
11121027
**What Gets Packaged**:
11131028

11141029
-`ggsql` CLI binary only
1115-
-`ggsql-rest` API server (install separately with `cargo install ggsql --features rest-api`)
11161030
-`ggsql-jupyter` kernel (install separately with `cargo install ggsql-jupyter`)
11171031

11181032
### Release Process
@@ -1140,6 +1054,7 @@ ggsql uses [cargo-packager](https://github.com/crabnebula-dev/cargo-packager) to
11401054
- Generate release notes
11411055

11421056
**Manual Workflow Trigger** (for testing):
1057+
11431058
```bash
11441059
gh workflow run release-installers.yml
11451060
```
@@ -1199,7 +1114,7 @@ Where `<global_mapping>` can be:
11991114
| `PLACE` | ✅ Yes | Annotation layers | `PLACE point SETTING x => 5, y => 10` |
12001115
| `SCALE` | ✅ Yes | Configure scales | `SCALE x VIA date` |
12011116
| `FACET` | ❌ No | Small multiples | `FACET region` |
1202-
| `PROJECT` | ❌ No | Coordinate system | `PROJECT TO cartesian` |
1117+
| `PROJECT` | ❌ No | Coordinate system | `PROJECT TO cartesian` |
12031118
| `LABEL` | ❌ No | Text labels | `LABEL title => 'My Chart', x => 'Date'` |
12041119
| `THEME` | ❌ No | Visual styling | `THEME minimal` |
12051120

@@ -1488,10 +1403,10 @@ PROJECT [<aesthetic>, ...] TO <coord_type>
14881403

14891404
**Coordinate Types**:
14901405

1491-
| Coord Type | Default Aesthetics | Description |
1492-
|------------|-------------------|-------------|
1493-
| `cartesian` | `x`, `y` | Standard x/y Cartesian coordinates |
1494-
| `polar` | `angle`, `radius` | Polar coordinates (for pie charts, rose plots) |
1406+
| Coord Type | Default Aesthetics | Description |
1407+
| ----------- | ------------------ | ---------------------------------------------- |
1408+
| `cartesian` | `x`, `y` | Standard x/y Cartesian coordinates |
1409+
| `polar` | `angle`, `radius` | Polar coordinates (for pie charts, rose plots) |
14951410

14961411
**Flipping Axes**:
14971412

Cargo.lock

Lines changed: 2 additions & 111 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@ chrono = "0.4"
7070
rand = "0.8"
7171
const_format = "0.2"
7272
uuid = { version = "1.0", features = ["v4"] }
73-
74-
# Web server
75-
axum = "0.7"
7673
tokio = { version = "1.35", default-features = false }
77-
tower-http = { version = "0.5", features = ["cors", "trace"] }
7874
tracing = "0.1"
7975
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
8076

0 commit comments

Comments
 (0)