pub trait StorageNamespace:
Send
+ Sync
+ 'static {
type Pager: Pager<Blob = EntryHandle> + Send + Sync + 'static;
// Required methods
fn namespace_id(&self) -> &NamespaceId;
fn context(&self) -> Arc<RuntimeContext<Self::Pager>>;
fn create_table(
&self,
plan: CreateTablePlan,
) -> Result<RuntimeStatementResult<Self::Pager>>;
fn drop_table(&self, name: &str, if_exists: bool) -> Result<()>;
fn create_index(
&self,
plan: CreateIndexPlan,
) -> Result<RuntimeStatementResult<Self::Pager>>;
fn lookup_table(
&self,
canonical: &str,
) -> Result<Arc<ExecutorTable<Self::Pager>>>;
fn list_tables(&self) -> Vec<String>;
// Provided methods
fn execute_operation(
&self,
operation: PlanOperation,
) -> Result<TransactionResult<Self::Pager>> { ... }
fn owns_table(&self, canonical: &str) -> bool { ... }
}Expand description
Trait implemented by all runtime storage namespaces.
Each namespace encapsulates a single storage backend (pager + catalog + table cache). Namespaces expose a minimal API so higher layers (RuntimeSession, SQL engine) can route operations without hard-coding per-namespace logic.
Required Associated Types§
Required Methods§
Sourcefn namespace_id(&self) -> &NamespaceId
fn namespace_id(&self) -> &NamespaceId
Identifier used when resolving schemas (e.g. “main”, “temp”).
Sourcefn context(&self) -> Arc<RuntimeContext<Self::Pager>>
fn context(&self) -> Arc<RuntimeContext<Self::Pager>>
Returns the runtime context bound to this namespace.
Sourcefn create_table(
&self,
plan: CreateTablePlan,
) -> Result<RuntimeStatementResult<Self::Pager>>
fn create_table( &self, plan: CreateTablePlan, ) -> Result<RuntimeStatementResult<Self::Pager>>
Create a table inside this namespace.
Sourcefn drop_table(&self, name: &str, if_exists: bool) -> Result<()>
fn drop_table(&self, name: &str, if_exists: bool) -> Result<()>
Drop a table from this namespace.
Sourcefn create_index(
&self,
plan: CreateIndexPlan,
) -> Result<RuntimeStatementResult<Self::Pager>>
fn create_index( &self, plan: CreateIndexPlan, ) -> Result<RuntimeStatementResult<Self::Pager>>
Create an index inside this namespace.
Sourcefn lookup_table(
&self,
canonical: &str,
) -> Result<Arc<ExecutorTable<Self::Pager>>>
fn lookup_table( &self, canonical: &str, ) -> Result<Arc<ExecutorTable<Self::Pager>>>
Lookup a table by canonical name.
Sourcefn list_tables(&self) -> Vec<String>
fn list_tables(&self) -> Vec<String>
List tables visible to this namespace.
Provided Methods§
Sourcefn execute_operation(
&self,
operation: PlanOperation,
) -> Result<TransactionResult<Self::Pager>>
fn execute_operation( &self, operation: PlanOperation, ) -> Result<TransactionResult<Self::Pager>>
Execute a generic plan operation. Namespaces that do not yet support this entry point should rely on the default error implementation.
Sourcefn owns_table(&self, canonical: &str) -> bool
fn owns_table(&self, canonical: &str) -> bool
Returns true if the namespace owns (and should answer for) the canonical table name.