pub struct SchemaManager { /* private fields */ }Expand description
Schema management service for handling table schemas and UDT definitions
Implementations§
Source§impl SchemaManager
impl SchemaManager
Sourcepub async fn new<P: AsRef<Path>>(path: P) -> Result<Self>
pub async fn new<P: AsRef<Path>>(path: P) -> Result<Self>
Create a new schema manager from a path
Sourcepub async fn new_with_storage(
storage: Arc<StorageEngine>,
_config: &Config,
) -> Result<Self>
pub async fn new_with_storage( storage: Arc<StorageEngine>, _config: &Config, ) -> Result<Self>
Create a new schema manager with storage
Sourcepub async fn new_with_registry(
storage: Arc<StorageEngine>,
registry: Arc<RwLock<SchemaRegistry>>,
_config: &Config,
) -> Result<Self>
pub async fn new_with_registry( storage: Arc<StorageEngine>, registry: Arc<RwLock<SchemaRegistry>>, _config: &Config, ) -> Result<Self>
Create a new schema manager with a pre-loaded SchemaRegistry
This constructor is used when schemas are loaded from external .cql files during ingestion, allowing the pre-loaded schemas to be used by the query engine.
§Arguments
storage- The storage engine instanceregistry- Pre-loaded schema registry from ingestion_config- Database configuration (currently unused)
Sourcepub async fn register_udt(&self, udt_def: UdtTypeDef)
pub async fn register_udt(&self, udt_def: UdtTypeDef)
Register a new UDT type definition
Sourcepub async fn get_udt(&self, keyspace: &str, name: &str) -> Option<UdtTypeDef>
pub async fn get_udt(&self, keyspace: &str, name: &str) -> Option<UdtTypeDef>
Get a UDT definition (returns a cloned UdtTypeDef)
Sourcepub async fn load_schema(&self, table_name: &str) -> Result<TableSchema>
pub async fn load_schema(&self, table_name: &str) -> Result<TableSchema>
Load schema for a table
Sourcepub async fn parse_and_register_cql_schema(
&self,
cql: &str,
) -> Result<TableSchema>
pub async fn parse_and_register_cql_schema( &self, cql: &str, ) -> Result<TableSchema>
Parse and register a schema from a CQL CREATE TABLE statement
Sourcepub async fn find_schema_by_table(
&self,
keyspace: &Option<String>,
table: &str,
) -> Option<TableSchema>
pub async fn find_schema_by_table( &self, keyspace: &Option<String>, table: &str, ) -> Option<TableSchema>
Find schema by table name with optional keyspace matching
Sourcepub fn extract_table_info(&self, cql: &str) -> Result<(Option<String>, String)>
pub fn extract_table_info(&self, cql: &str) -> Result<(Option<String>, String)>
Extract table information from CQL without full parsing
Sourcepub fn cql_type_to_internal(&self, cql_type: &str) -> Result<CqlTypeId>
pub fn cql_type_to_internal(&self, cql_type: &str) -> Result<CqlTypeId>
Convert CQL type string to internal type ID
Sourcepub async fn get_table_schema(&self, table_name: &str) -> Result<TableSchema>
pub async fn get_table_schema(&self, table_name: &str) -> Result<TableSchema>
Get table schema by name (async for compatibility)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SchemaManager
impl !UnwindSafe for SchemaManager
impl Freeze for SchemaManager
impl Send for SchemaManager
impl Sync for SchemaManager
impl Unpin for SchemaManager
impl UnsafeUnpin for SchemaManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more