MCPcopy Create free account
hub / github.com/encrypted-spaces/prototype / Storage

Interface Storage

backend/src/storage.rs:5–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3
4#[async_trait::async_trait]
5pub trait Storage: Send + Sync {
6 async fn create_table(&self, schema: &Schema) -> Result<()>;
7
8 /// Execute UPDATE or DELETE query with access control enforcement
9 async fn update_or_delete(&self, query: Query, auth_context: &AuthContext) -> Result<usize>;
10
11 /// Execute INSERT query with access control enforcement, returning the inserted ID
12 async fn insert(&self, query: Query, auth_context: &AuthContext) -> Result<i64>;
13
14 /// Execute SELECT query, returning a single row.
15 async fn select_one<T>(&self, query: Query) -> Result<Option<T>>
16 where
17 T: for<'de> Deserialize<'de>;
18
19 /// Execute SELECT query, returning multiple rows.
20 async fn select_all<T>(&self, query: Query) -> Result<Vec<T>>
21 where
22 T: for<'de> Deserialize<'de>;
23}

Callers

nothing calls this directly

Implementers 1

mod.rsbackend/src/merk_storage/mod.rs

Calls

no outgoing calls

Tested by

no test coverage detected