Expand description
SQLite and PostgreSQL storage adapters for codlet (RFC-011, RFC-034).
§Backends
| Feature | Type | Connection | Use case |
|---|---|---|---|
sqlite (default) | SqliteStore | "sqlite::memory:", "sqlite:path/to/db" | Local dev, single-server |
postgres | PostgresStore | postgres://… | Multi-instance production |
Both stores implement CodeStore + SessionStore + FormTokenStore + CodeAdminStore and pass the full codlet-conformance suite.
§Atomicity guarantee
Every one-time transition (code claim, form-token consume) uses a single
UPDATE … WHERE … AND <guard> checked via rows_affected(). For
PostgreSQL, READ COMMITTED isolation + row-level locking means concurrent
updates serialise at the row — exactly one wins. No SERIALIZABLE
isolation or RETURNING clause is needed or used (RFC-034 §7).
§Conformance
All stores pass the codlet-conformance suite including the concurrent
claim race test (RFC-022, RFC-023).
Re-exports§
pub use migration::run_migrations;
Modules§
- admin
CodeAdminStoreimplementation forSqliteStore.- code
- SQLite implementation of
codlet_core::store::code::CodeStore. - migration
- Migration runner for codlet SQLite tables (RFC-011 §10.4).
- session
- SQLite implementation of
codlet_core::store::session::SessionStore. - token
- SQLite implementation of
codlet_core::store::token::FormTokenStore.
Structs§
- Sqlite
Store - A handle wrapping a
sqlx::SqlitePoolthat implements all codlet store traits (RFC-011).