Skip to main content

SchemaManager

Struct SchemaManager 

Source
pub struct SchemaManager { /* private fields */ }
Expand description

Schema management service for handling table schemas and UDT definitions

Implementations§

Source§

impl SchemaManager

Source

pub async fn new<P: AsRef<Path>>(path: P) -> Result<Self>

Create a new schema manager from a path

Source

pub async fn new_with_storage( storage: Arc<StorageEngine>, _config: &Config, ) -> Result<Self>

Create a new schema manager with storage

Source

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 instance
  • registry - Pre-loaded schema registry from ingestion
  • _config - Database configuration (currently unused)
Source

pub async fn register_udt(&self, udt_def: UdtTypeDef)

Register a new UDT type definition

Source

pub async fn get_udt(&self, keyspace: &str, name: &str) -> Option<UdtTypeDef>

Get a UDT definition (returns a cloned UdtTypeDef)

Source

pub async fn load_schema(&self, table_name: &str) -> Result<TableSchema>

Load schema for a table

Source

pub async fn parse_and_register_cql_schema( &self, cql: &str, ) -> Result<TableSchema>

Parse and register a schema from a CQL CREATE TABLE statement

Source

pub async fn find_schema_by_table( &self, keyspace: &Option<String>, table: &str, ) -> Option<TableSchema>

Find schema by table name with optional keyspace matching

Source

pub fn extract_table_info(&self, cql: &str) -> Result<(Option<String>, String)>

Extract table information from CQL without full parsing

Source

pub fn cql_type_to_internal(&self, cql_type: &str) -> Result<CqlTypeId>

Convert CQL type string to internal type ID

Source

pub async fn get_table_schema(&self, table_name: &str) -> Result<TableSchema>

Get table schema by name (async for compatibility)

Trait Implementations§

Source§

impl Debug for SchemaManager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.