pub trait RuntimeStorageNamespace:
Send
+ Sync
+ 'static {
Show 13 methods
// Required methods
fn namespace_id(&self) -> &RuntimeNamespaceId;
fn context(&self) -> Arc<RuntimeContext<BoxedPager>>;
fn create_table(
&self,
plan: CreateTablePlan,
) -> Result<RuntimeStatementResult<BoxedPager>>;
fn drop_table(&self, plan: DropTablePlan) -> Result<()>;
fn rename_table(&self, plan: RenameTablePlan) -> Result<()>;
fn alter_table(
&self,
plan: AlterTablePlan,
) -> Result<RuntimeStatementResult<BoxedPager>>;
fn create_index(
&self,
plan: CreateIndexPlan,
) -> Result<RuntimeStatementResult<BoxedPager>>;
fn drop_index(
&self,
plan: DropIndexPlan,
) -> Result<Option<SingleColumnIndexDescriptor>>;
fn create_view(&self, plan: CreateViewPlan) -> Result<()>;
fn drop_view(&self, plan: DropViewPlan) -> Result<()>;
fn lookup_table(
&self,
canonical: &str,
) -> Result<Arc<ExecutorTable<BoxedPager>>>;
fn list_tables(&self) -> Vec<String>;
// Provided method
fn execute_operation(
&self,
operation: PlanOperation,
) -> Result<TransactionResult<BoxedPager>> { ... }
}Expand description
Runtime-level namespace abstraction.
Implementors wrap a RuntimeContext for a specific routing domain (e.g.
persistent tables, temporary tables). The namespace knows how to forward
DDL/DML plan execution into the underlying context, but it does not
perform storage allocation or manage physical pagers on its own.
Required Methods§
Sourcefn namespace_id(&self) -> &RuntimeNamespaceId
fn namespace_id(&self) -> &RuntimeNamespaceId
Identifier used when resolving schemas (e.g. “main”, “temp”).
Sourcefn context(&self) -> Arc<RuntimeContext<BoxedPager>>
fn context(&self) -> Arc<RuntimeContext<BoxedPager>>
Returns the runtime context bound to this namespace.
Sourcefn create_table(
&self,
plan: CreateTablePlan,
) -> Result<RuntimeStatementResult<BoxedPager>>
fn create_table( &self, plan: CreateTablePlan, ) -> Result<RuntimeStatementResult<BoxedPager>>
Create a table inside this namespace.
Sourcefn drop_table(&self, plan: DropTablePlan) -> Result<()>
fn drop_table(&self, plan: DropTablePlan) -> Result<()>
Drop a table from this namespace by forwarding the planned request.
Sourcefn rename_table(&self, plan: RenameTablePlan) -> Result<()>
fn rename_table(&self, plan: RenameTablePlan) -> Result<()>
Rename a table within this namespace.
Sourcefn alter_table(
&self,
plan: AlterTablePlan,
) -> Result<RuntimeStatementResult<BoxedPager>>
fn alter_table( &self, plan: AlterTablePlan, ) -> Result<RuntimeStatementResult<BoxedPager>>
Alter a table within this namespace.
Sourcefn create_index(
&self,
plan: CreateIndexPlan,
) -> Result<RuntimeStatementResult<BoxedPager>>
fn create_index( &self, plan: CreateIndexPlan, ) -> Result<RuntimeStatementResult<BoxedPager>>
Create an index within this namespace.
Sourcefn drop_index(
&self,
plan: DropIndexPlan,
) -> Result<Option<SingleColumnIndexDescriptor>>
fn drop_index( &self, plan: DropIndexPlan, ) -> Result<Option<SingleColumnIndexDescriptor>>
Drop an index from this namespace by forwarding the request.
Sourcefn create_view(&self, plan: CreateViewPlan) -> Result<()>
fn create_view(&self, plan: CreateViewPlan) -> Result<()>
Create a view inside this namespace.
Sourcefn drop_view(&self, plan: DropViewPlan) -> Result<()>
fn drop_view(&self, plan: DropViewPlan) -> Result<()>
Drop a view from this namespace by forwarding the planned request.
Sourcefn lookup_table(
&self,
canonical: &str,
) -> Result<Arc<ExecutorTable<BoxedPager>>>
fn lookup_table( &self, canonical: &str, ) -> Result<Arc<ExecutorTable<BoxedPager>>>
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<BoxedPager>>
fn execute_operation( &self, operation: PlanOperation, ) -> Result<TransactionResult<BoxedPager>>
Execute a generic plan operation. Namespaces that do not yet support this entry point should override this method.