pub struct SqliteRefTable { /* private fields */ }Expand description
The sqlite row-CAS twin over the co-tenant git_refs rows
(substrate.md §refs, ADR-019 §2) — the atomic realization as the
one-transaction home: every GitRefs::apply_updates call runs all
its CAS check-and-applies inside one BEGIN IMMEDIATE transaction
on the co-tenant connection (the migration-checked schema from
substrate/w6-migrations), so two clashing applies — from this
process or a co-tenant connection of another — serialize on the row
write lock and the loser sees the committed winner (stale info),
while an atomic denial rolls its transaction back whole, leaving the
rows exactly as they were (POC-O’s demonstrated shapes, DQ-2).
Blocking SQL bridges off the async executor
(tokio::task::spawn_blocking) per the composition’s concurrency
model; the co-tenant handle’s pinned busy timeout absorbs the
cross-process write-lock waits. Construction takes the
already-migrated handle (CoTenantSqlite::open
runs the migrations) — no construction I/O here.
Implementations§
Source§impl SqliteRefTable
impl SqliteRefTable
Sourcepub fn new(handle: CoTenantSqlite) -> Self
pub fn new(handle: CoTenantSqlite) -> Self
Mount the refs row CAS over a co-tenant handle (the same handle the sqlite registry twin consumes).
Trait Implementations§
Source§impl GitRefs for SqliteRefTable
impl GitRefs for SqliteRefTable
Source§fn list_refs<'life0, 'life1, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRecord,
) -> Pin<Box<dyn Future<Output = Result<Vec<RefLine>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_refs<'life0, 'life1, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRecord,
) -> Pin<Box<dyn Future<Output = Result<Vec<RefLine>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn apply_updates<'life0, 'life1, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRecord,
updates: Vec<RefUpdate>,
atomic: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<RefOutcome>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn apply_updates<'life0, 'life1, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRecord,
updates: Vec<RefUpdate>,
atomic: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<RefOutcome>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
RefOutcome),
not errors (a stale ref is a business result of receive-pack —
ADR-013 §7–8). Read moreSource§impl RefRows for SqliteRefTable
The liveness seam’s row read: one ordered query over the
co-tenant rows (ORDER BY repo_id, name — the canonical
order the fingerprint folds), bridged off the executor like
every blocking-SQL leg.
impl RefRows for SqliteRefTable
The liveness seam’s row read: one ordered query over the
co-tenant rows (ORDER BY repo_id, name — the canonical
order the fingerprint folds), bridged off the executor like
every blocking-SQL leg.