Skip to main content

ClickHouseDialect

Struct ClickHouseDialect 

Source
pub struct ClickHouseDialect;
Expand description

ClickHouse 方言实现(列式 OLAP 数据库)

Trait Implementations§

Source§

impl Dialect for ClickHouseDialect

Source§

fn db_type(&self) -> DbType

返回该方言对应的数据库类型
Source§

fn quote(&self, identifier: &str) -> String

引用标识符(表名、列名等)
Source§

fn escape_string(&self, s: &str) -> String

转义字符串字面量,确保可安全嵌入 SQL
Source§

fn supports_returning(&self) -> bool

该方言是否支持 RETURNING 子句
Source§

fn build_pagination(&self, sql: &str, page: u64, limit: u64) -> String

生成分页 SQL
Source§

fn json_type(&self) -> &'static str

获取 JSON 类型的 SQL 类型名
Source§

fn json_extract(&self, column: &str, path: &str) -> String

生成 JSON_EXTRACT 函数调用
生成全文检索 SQL
Source§

fn bool_to_int(&self, expr: &str) -> String

将布尔表达式转换为整型存储
Source§

fn concat(&self, parts: &[&str]) -> String

生成 CONCAT 函数调用
Source§

fn supports_if_exists(&self) -> bool

该方言是否支持 IF EXISTS
Source§

fn supports_if_not_exists(&self) -> bool

该方言是否支持 IF NOT EXISTS
Source§

fn auto_increment_keyword(&self) -> &'static str

获取自增列关键字
Source§

fn last_insert_id_sql(&self) -> Option<&'static str>

获取最近插入 ID 的 SQL(独立可执行语句) Read more
Source§

fn build_create_table(&self, table: &str, columns: &[ColumnDef]) -> String

生成 CREATE TABLE 语句
Source§

fn build_alter_table(&self, table: &str, changes: &[TableChange]) -> String

生成 ALTER TABLE 语句
Source§

fn quote_checked(&self, identifier: &str) -> Result<String, DbError>

L-4 修复:带校验的引用标识符 Read more
Source§

fn build_drop_table(&self, table: &str, if_exists: bool) -> String

生成 DROP TABLE 语句 Read more
Source§

fn build_upsert_on_conflict( &self, conflict_columns: &[&str], update_columns: &[&str], all_columns: &[String], ) -> Option<String>

P2-6:生成批量 upsert 的冲突处理子句(ON CONFLICT / ON DUPLICATE KEY UPDATE) 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more