factstr-postgres
factstr-postgres is the PostgreSQL-backed store implementation for the shared factstr contract.
Use this crate when an application already operates PostgreSQL and wants FACTSTR persistence there.
What it implements
factstr-postgres implements the shared factstr::EventStore contract, including:
appendqueryappend_ifstream_allstream_tostream_all_durablestream_to_durable
When to use it
Use factstr-postgres when:
- you want FACTSTR backed by PostgreSQL
- your application already operates PostgreSQL
- you want durable stream cursor state to persist in PostgreSQL
Store behavior and boundaries
- Committed facts and durable stream cursors are stored in PostgreSQL.
- SQL transactions and indexes are used internally.
- An internal worker thread keeps the synchronous store API safe to call from inside a running Tokio runtime.
- Durable replay depends on persisted append-batch history.
- Older databases without contiguous append-batch history are rejected for durable replay instead of being silently backfilled.
Integration tests for this crate require a PostgreSQL database.
Add to Cargo.toml
[]
= "0.3"
= "0.3"
Minimal example
use ;
use PostgresStore;
use json;
use env;
Related crates
factstr: shared contract and core typesfactstr-memory: in-memory storefactstr-sqlite: embedded persistent store
License
Licensed under either of:
- MIT license
- Apache License, Version 2.0