pub trait VtabModuleFactory: Send + Sync {
// Required method
fn create(
&self,
cx: &Cx,
args: &[&str],
) -> Result<Box<dyn ErasedVtabInstance>>;
// Provided methods
fn connect(
&self,
cx: &Cx,
args: &[&str],
) -> Result<Box<dyn ErasedVtabInstance>> { ... }
fn column_info(&self, _args: &[&str]) -> Vec<(String, char)> { ... }
fn module_metadata(&self, _args: &[&str]) -> VtabModuleMetadata { ... }
fn shadow_table_policy(
&self,
_vtab_name: &str,
_table_name: &str,
) -> ShadowTablePolicy { ... }
}Expand description
A type-erased virtual table module factory.
Registered with the connection via register_module("name", factory).
When CREATE VIRTUAL TABLE ... USING name(args) is executed, the
factory’s create method is called to produce a concrete vtab instance.
Required Methods§
Provided Methods§
Sourcefn connect(&self, cx: &Cx, args: &[&str]) -> Result<Box<dyn ErasedVtabInstance>>
fn connect(&self, cx: &Cx, args: &[&str]) -> Result<Box<dyn ErasedVtabInstance>>
Connect to an existing virtual table (subsequent opens).
Sourcefn column_info(&self, _args: &[&str]) -> Vec<(String, char)>
fn column_info(&self, _args: &[&str]) -> Vec<(String, char)>
Column names and affinities for the virtual table schema.
Sourcefn module_metadata(&self, _args: &[&str]) -> VtabModuleMetadata
fn module_metadata(&self, _args: &[&str]) -> VtabModuleMetadata
Static metadata for the module as a whole.
Sourcefn shadow_table_policy(
&self,
_vtab_name: &str,
_table_name: &str,
) -> ShadowTablePolicy
fn shadow_table_policy( &self, _vtab_name: &str, _table_name: &str, ) -> ShadowTablePolicy
Determine whether table_name is a module-owned shadow table for the
virtual table instance named vtab_name.