pub struct MySqlFillerSync {
pub connection_string: String,
pub config: FillingConfig,
pub stats: FillingStats,
}Expand description
MySQL 填充器的同步包装器
Fields§
§connection_string: String§config: FillingConfig§stats: FillingStatsImplementations§
Source§impl MySqlFillerSync
impl MySqlFillerSync
Sourcepub fn new(connection_string: String, config: FillingConfig) -> Self
pub fn new(connection_string: String, config: FillingConfig) -> Self
创建同步版本的 MySQL 填充器
Sourcepub fn from_config(
config: ConnectionConfig,
filling_config: FillingConfig,
) -> Result<Self>
pub fn from_config( config: ConnectionConfig, filling_config: FillingConfig, ) -> Result<Self>
从连接配置创建
Sourcepub fn table_exists(&self, table_name: &str) -> Result<bool>
pub fn table_exists(&self, table_name: &str) -> Result<bool>
检查表是否存在
Sourcepub fn get_table_schema(&self, table_name: &str) -> Result<TableSchema>
pub fn get_table_schema(&self, table_name: &str) -> Result<TableSchema>
获取表结构
Trait Implementations§
Source§impl DatabaseFiller for MySqlFillerSync
impl DatabaseFiller for MySqlFillerSync
Source§fn create_table(&mut self, schema: &TableSchema) -> Result<()>
fn create_table(&mut self, schema: &TableSchema) -> Result<()>
创建表
Source§fn insert_data(
&mut self,
table_name: &str,
data: Vec<HashMap<String, Value>>,
) -> Result<()>
fn insert_data( &mut self, table_name: &str, data: Vec<HashMap<String, Value>>, ) -> Result<()>
插入数据
Source§fn batch_insert(
&mut self,
table_name: &str,
data: Vec<HashMap<String, Value>>,
) -> Result<()>
fn batch_insert( &mut self, table_name: &str, data: Vec<HashMap<String, Value>>, ) -> Result<()>
批量插入数据
Source§fn get_stats(&self) -> FillingStats
fn get_stats(&self) -> FillingStats
获取统计信息
Auto Trait Implementations§
impl Freeze for MySqlFillerSync
impl RefUnwindSafe for MySqlFillerSync
impl Send for MySqlFillerSync
impl Sync for MySqlFillerSync
impl Unpin for MySqlFillerSync
impl UnwindSafe for MySqlFillerSync
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