|
| 1 | +<!-- SPDX-License-Identifier: PMPL-1.0-or-later --> |
| 2 | +<!-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> --> |
| 3 | +# TOPOLOGY.md — typedqliser |
| 4 | + |
| 5 | +## Purpose |
| 6 | + |
| 7 | +typedqliser adds formal type safety to any query language (SQL, GraphQL, Datalog, Cypher, and beyond) and is the #1 priority in the -iser family. It reads a `typedqliser.toml` manifest specifying the query language, database backend, and type-safety level (1–10), then type-checks queries against the database schema and generates typed query wrappers with optional proof certificates. typedqliser is designed for teams who need compile-time guarantees that queries are well-typed with respect to their schema, preventing entire classes of runtime errors. |
| 8 | + |
| 9 | +## Module Map |
| 10 | + |
| 11 | +``` |
| 12 | +typedqliser/ |
| 13 | +├── src/ |
| 14 | +│ ├── main.rs # CLI entry point (clap): init, check, generate, build, run, info |
| 15 | +│ ├── lib.rs # Library API |
| 16 | +│ ├── manifest/mod.rs # typedqliser.toml parser |
| 17 | +│ ├── codegen/mod.rs # Typed query wrapper generation |
| 18 | +│ ├── plugins/ # Per-query-language plugins (SQL, GraphQL, Datalog, etc.) |
| 19 | +│ └── abi/ # Idris2 ABI bridge stubs |
| 20 | +├── examples/ # Worked examples |
| 21 | +├── verification/ # Proof harnesses |
| 22 | +├── container/ # Stapeln container ecosystem |
| 23 | +└── .machine_readable/ # A2ML metadata |
| 24 | +``` |
| 25 | + |
| 26 | +## Data Flow |
| 27 | + |
| 28 | +``` |
| 29 | +typedqliser.toml manifest |
| 30 | + │ |
| 31 | + ┌────▼────┐ |
| 32 | + │ Manifest │ parse + validate language, database backend, type-safety level |
| 33 | + │ Parser │ |
| 34 | + └────┬────┘ |
| 35 | + │ validated type config |
| 36 | + ┌────▼────┐ |
| 37 | + │ Analyser │ introspect database schema, parse queries, type-check against schema |
| 38 | + └────┬────┘ |
| 39 | + │ typed query IR + type errors (if any) |
| 40 | + ┌────▼────┐ |
| 41 | + │ Codegen │ emit generated/typedqliser/ (typed wrappers, optional proof certificates) |
| 42 | + └────┬────┘ |
| 43 | + │ type-safe query artifacts |
| 44 | + ┌────▼────┐ |
| 45 | + │ CI gate │ exit 1 on type errors (--ci mode) |
| 46 | + └─────────┘ |
| 47 | +``` |
0 commit comments