Repository navigation
Releases
Releases · Volland/typedb-lean
typedb-lean v0.2.0
Lean v4.37.0-rc1. Projects that depend on typedb-lean must use the same Lean toolchain; stay on v0.1.0 for Lean v4.35.0.
Changed
- Lean toolchain
v4.37.0-rc1(wasv4.35.0); doc-gen4v4.37.0-rc1for the API docs. No source changes were needed.
typedb-lean v0.1.0
First release: a TypeDB 3 client for Lean 4 over the official C driver (typedb-driver 3.14.0), for Lean v4.35.0.
Added
- Native layer: the C driver built from the pinned
typedb-drivertag by Lake and cargo, or a prebuilt library throughTYPEDB_DRIVER_LIB; a C shim that decodes many rows per native call. - Connections with credentials and optional TLS; database create, delete, list and schema.
Tx .read/.write/.schema: transaction bodies whose mode is checked at compile time;Driver.runSynccommits on success and rolls back on error; typedTypeDBError; opt-in retry of commit conflicts.Driver.run: transactions asStd.Async.EAsynccomputations on dedicated threads.typeql!: TypeQL with escaped, typed interpolation and an inferred transaction mode;Rawfor verbatim text.- Row decoders,
deriving FromRow, exact value types (Decimal,Duration,DatetimeTZ,Std.Timedates), strict, folded and streamed results, andfetchthroughLean.FromJson. - A lightweight ORM:
deriving Entity,RelationandPolymorphic; references by key or IID; subtypes throughextends; relations playing roles; multi-valued attributes; schema generation and verification. - Versioned up/down migrations with history and checksum drift detection stored in the database.
- Benchmarks against the official Rust driver (
lake exe bench), thesocialexample, a guide and API docs.
Requirements
- Building needs a Rust toolchain and
protoc(the driver's protocol crate compiles protobuf definitions).
Known limitations
- typedb-driver 3.14.0 retains about 600 bytes per opened transaction (upstream, also in its Rust API).
- Windows is not supported. On GitHub's macOS runners only the unit tests run, because they cannot run Linux containers.
Benchmarks against the official Rust driver (same server, typedb-driver 3.14.0)
| Workload | typedb-lean | Rust driver |
|---|---|---|
| Scan of 100k rows into structures | 155k rows/s | 142k rows/s |
| Point lookup, p50 / p99 | 1.05 / 1.52 ms | 1.03 / 2.39 ms |
| Bulk insert of 10k entities | 4.75 s | 4.71 s |
| 16 concurrent reads | 367 ms | 607 ms |
Install
require «typedb-lean» from git "https://github.com/Volland/typedb-lean" @ "v0.1.0"Building needs a Rust toolchain and protoc. See the guide and the API reference.