Skip to content

ST0x-Technology/event-sorcery

Repository files navigation

Event Sorcery

Event-sourcing primitives in Rust. A thin, opinionated layer on top of cqrs-es plus a SQLite-backed event store.

Crates

  • crates/sqlite-es — SQLite implementation of cqrs-es's event repository, view repository, and CqrsFramework glue. Standalone — usable wherever you'd plug in a cqrs-es backend.
  • crates/event-sorcery — higher-level ergonomics on top of sqlite-es: the EventSourced trait, Lifecycle adapter, typed Store, projections, schema registry, reactor.

event-sorcery is the recommended entry point. Use sqlite-es directly only if you need lower-level control.

Status

Extracted from internal services (st0x.issuance and st0x.liquidity) and made standalone so they can share the implementation. External users are welcome but the API surface is still in flux.

Examples

Runnable end-to-end examples live under examples/ — one directory per concept (basic_entity, projection, reactor), each with its own README explaining what it covers. Run any of them with cargo run -p event-sorcery --example <name>.

Documentation

  • docs/domain.md — domain terminology and naming conventions.
  • docs/cqrs.md — event-sourcing patterns, the EventSourced trait, projections, services, schema registry.
  • docs/sqlx.mdSQLX_OFFLINE, query! vs runtime queries, regenerating the query cache.
  • docs/ttdd.md — type-driven TDD methodology used in this project.

Development

nix develop          # rust toolchain + sqlx-cli + cargo-nextest
cargo check --workspace
cargo nextest run --workspace

See AGENTS.md for contribution conventions.

License

MIT — see LICENSE.

About

Event sourcing but with type-level magic to prevent shooting yourself in the foot while loading the gun aggregate.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages