pub struct MySqlDialect;Expand description
MySQL 方言实现
Trait Implementations§
Source§impl Dialect for MySqlDialect
impl Dialect for MySqlDialect
Source§fn build_upsert_on_conflict(
&self,
_conflict_columns: &[&str],
update_columns: &[&str],
all_columns: &[String],
) -> Option<String>
fn build_upsert_on_conflict( &self, _conflict_columns: &[&str], update_columns: &[&str], all_columns: &[String], ) -> Option<String>
P2-6:MySQL 批量 upsert — ON DUPLICATE KEY UPDATE col=VALUES(col), ...
MySQL 不需要指定冲突列(自动检测唯一键/主键冲突)。
conflict_columns 参数在 MySQL 方言中被忽略。
Source§fn escape_string(&self, s: &str) -> String
fn escape_string(&self, s: &str) -> String
转义字符串字面量,确保可安全嵌入 SQL
Source§fn supports_returning(&self) -> bool
fn supports_returning(&self) -> bool
该方言是否支持 RETURNING 子句
Source§fn bool_to_int(&self, expr: &str) -> String
fn bool_to_int(&self, expr: &str) -> String
将布尔表达式转换为整型存储
Source§fn supports_if_exists(&self) -> bool
fn supports_if_exists(&self) -> bool
该方言是否支持 IF EXISTS
Source§fn supports_if_not_exists(&self) -> bool
fn supports_if_not_exists(&self) -> bool
该方言是否支持 IF NOT EXISTS
Source§fn auto_increment_keyword(&self) -> &'static str
fn auto_increment_keyword(&self) -> &'static str
获取自增列关键字
Source§fn build_alter_table(&self, table: &str, changes: &[TableChange]) -> String
fn build_alter_table(&self, table: &str, changes: &[TableChange]) -> String
生成 ALTER TABLE 语句
Auto Trait Implementations§
impl Freeze for MySqlDialect
impl RefUnwindSafe for MySqlDialect
impl Send for MySqlDialect
impl Sync for MySqlDialect
impl Unpin for MySqlDialect
impl UnsafeUnpin for MySqlDialect
impl UnwindSafe for MySqlDialect
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