pub struct SQLiteStore { /* private fields */ }Implementations§
Source§impl SQLiteStore
impl SQLiteStore
Sourcepub fn migrate_legacy(path: impl AsRef<Path>) -> Result<Self>
pub fn migrate_legacy(path: impl AsRef<Path>) -> Result<Self>
Explicitly migrate an existing schema 0/1/2 database in one transaction. Ordinary opens and all read-only access remain non-migrating. Back up an existing recording before requesting migration. Unknown versions and malformed nodes are rejected without committing schema/data changes.
pub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open_read_only(path: impl AsRef<Path>) -> Result<Self>
Sourcepub fn open_with_options(
path: impl AsRef<Path>,
read_only: bool,
intern_threshold: Option<usize>,
) -> Result<Self>
pub fn open_with_options( path: impl AsRef<Path>, read_only: bool, intern_threshold: Option<usize>, ) -> Result<Self>
None disables interning. Existing legacy schemas are refused, never repaired.
pub fn is_read_only(&self) -> bool
Sourcepub fn reserve(
&mut self,
reservation_id: &str,
budgets: &[BudgetReservation],
windows: &[WindowReservation],
lease_seconds: f64,
) -> Result<ReservationCheck>
pub fn reserve( &mut self, reservation_id: &str, budgets: &[BudgetReservation], windows: &[WindowReservation], lease_seconds: f64, ) -> Result<ReservationCheck>
Explicit reserve operation, serialized across independent SQLite connections. Direct callers must settle or release accepted reservations and renew leases while work is in flight. RecordingStore hooks expose these operations to Runtime.
Sourcepub fn reserve_decimal_text(
&mut self,
reservation_id: &str,
budgets: &[TextBudgetReservation],
windows: &[TextWindowReservation],
lease_seconds: f64,
) -> Result<ReservationCheck>
pub fn reserve_decimal_text( &mut self, reservation_id: &str, budgets: &[TextBudgetReservation], windows: &[TextWindowReservation], lease_seconds: f64, ) -> Result<ReservationCheck>
Preserve Python Decimal text in SQLite ledger rows. SQLite’s schema-v3 retry semantics are unchanged (active duplicate IDs are refused).
Sourcepub fn settle(
&mut self,
reservation_id: &str,
charges: &BTreeMap<String, Decimal>,
) -> Result<()>
pub fn settle( &mut self, reservation_id: &str, charges: &BTreeMap<String, Decimal>, ) -> Result<()>
Settle each reserved budget/window once, then remove its reservation rows. Repeating settlement after success is idempotent, matching Python.
Sourcepub fn settle_decimal_text(
&mut self,
reservation_id: &str,
charges: &BTreeMap<String, String>,
) -> Result<()>
pub fn settle_decimal_text( &mut self, reservation_id: &str, charges: &BTreeMap<String, String>, ) -> Result<()>
Settle using the original Python Decimal scale/exponent for ledger text.
pub fn release(&mut self, reservation_id: &str) -> Result<()>
pub fn renew( &mut self, reservation_id: &str, lease_seconds: f64, ) -> Result<bool>
Trait Implementations§
Source§impl RecordingStore for SQLiteStore
impl RecordingStore for SQLiteStore
Source§fn ancestry_snapshot(&self, id: &str) -> Result<Option<Vec<Node>>>
fn ancestry_snapshot(&self, id: &str) -> Result<Option<Vec<Node>>>
Source§fn subtree_snapshot(&self, root: &str) -> Result<Option<Vec<Node>>>
fn subtree_snapshot(&self, root: &str) -> Result<Option<Vec<Node>>>
Source§fn cache_revision(&self) -> Option<StoreRevision>
fn cache_revision(&self) -> Option<StoreRevision>
external.
A single-node write must not modify other cached nodes; such side effects
require changing external or returning None instead.
Runtimes recheck tokens after scans and discard caches on any change.