pub struct SchemaParser { /* private fields */ }Expand description
Schema解析器
Implementations§
Source§impl SchemaParser
impl SchemaParser
Sourcepub fn infer_from_json(&self, json_schema: &Value) -> Result<TableSchema>
pub fn infer_from_json(&self, json_schema: &Value) -> Result<TableSchema>
从JSON Schema推断表结构
Sourcepub fn infer_from_database_table(
&self,
table_info: &DatabaseTableInfo,
) -> Result<TableSchema>
pub fn infer_from_database_table( &self, table_info: &DatabaseTableInfo, ) -> Result<TableSchema>
从数据库表结构推断Schema
Sourcepub fn map_database_type(&self, db_type: &str) -> Result<DataType>
pub fn map_database_type(&self, db_type: &str) -> Result<DataType>
映射数据库类型到内部类型
Sourcepub fn add_type_mapping(&mut self, db_type: String, data_type: DataType)
pub fn add_type_mapping(&mut self, db_type: String, data_type: DataType)
添加自定义类型映射
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SchemaParser
impl RefUnwindSafe for SchemaParser
impl Send for SchemaParser
impl Sync for SchemaParser
impl Unpin for SchemaParser
impl UnwindSafe for SchemaParser
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more