This commit is contained in:
Hassan Abedi 2026-06-05 13:26:13 +02:00
parent 6560c2696f
commit 31ef67850b

View File

@ -1,37 +1,8 @@
## Crates ## Crate Overview
Each subdirectory is a Cargo package with its own `Cargo.toml`. | Crate | Kind | Responsibility |
Layout: |-----------------|--------------------|-------------------------------------------------------------------------------------------------------------------------------|
| `storage` | library | Defines the interface to use these storage backends. |
```text | `query-ops` | library | Provides a set of operators to physcially execute a query. |
crates/ | `plan-runner` | library and binary | Provides a CLI to run a query plan represnetsion against a given storage backend uisng the operatirs provided by `query-ops`. |
app-name/ | `geomerge-demo` | binary | An example that shows how to write and read to Geomerge (as a storage). |
Cargo.toml
src/
main.rs
```
### Responsibilities and Dependencies
| Crate | Kind | Responsibility | Depends On |
|------------------|-----------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|
| `storage` | library | Backend-agnostic `Storage` and `Transaction` traits, plus adapters: `MemoryStorage`, `LmdbStorage`, `RedbStorage`, `FjallStorage`, `SqliteStorage`, `GeomergeStorage` (feature-gated). Owns `Value`, `Table`, `RowId`, `StorageError`, `CodecError`. | external `geomerge` (only with the `geomerge` feature) |
| `query-ops` | library | Snapshot query operators: `scan_atom`, `semijoin`, `natural_join`. Owns `Relation`, `AtomPattern`, `Term`. | `storage` |
| `plan-runner` | library + `plan-run` CLI | Executes JSON plan IR against a chosen `Storage` backend via `--backend {memory \| memory-storage \| lmdb \| redb \| fjall \| sqlite \| geomerge}`. Walks the DAG using `query-ops` operators and verifies against `expected_bindings`. | `query-ops`, `storage` (all adapter features) |
| `geomerge-demo` | binary | End-to-end example exercising `GeomergeStorage`: theory loading, transactional inserts, scan, persistence round trip, law validation. | `storage` (with `geomerge`), external `geomerge` |
The dependency edges form a strict DAG:
```text
storage ◄── query-ops ◄── plan-runner
▲ │
└── geomerge-demo │
(also depends on │
external geomerge) │
(all storage features on)
```
No cycles, no upward dependencies.
`query-ops` and `plan-runner` are layered above `storage`;
`geomerge-demo` sits beside them as a runnable example.