pub struct SnowflakeDialect;Expand description
Snowflake 方言实现(云数仓,独立实现)
支持 Snowflake 特有特性:
- VARIANT/OBJECT/ARRAY 半结构化类型
- COPY INTO 数据加载
- TIME TRAVEL 时间旅行查询
Implementations§
Source§impl SnowflakeDialect
Snowflake 特有 SQL 构造方法
impl SnowflakeDialect
Snowflake 特有 SQL 构造方法
Sourcepub fn build_copy_into(&self, target: &str, source: &str) -> String
pub fn build_copy_into(&self, target: &str, source: &str) -> String
生成 COPY INTO 数据加载语句
COPY INTO target FROM source
Sourcepub fn build_time_travel_at(&self, table: &str, timestamp: &str) -> String
pub fn build_time_travel_at(&self, table: &str, timestamp: &str) -> String
生成 TIME TRAVEL AT 查询语句
SELECT * FROM table AT(OBJECT => timestamp)
Sourcepub fn build_time_travel_before(&self, table: &str, timestamp: &str) -> String
pub fn build_time_travel_before(&self, table: &str, timestamp: &str) -> String
生成 TIME TRAVEL BEFORE 查询语句
SELECT * FROM table BEFORE(timestamp => timestamp)
Trait Implementations§
Source§impl Clone for SnowflakeDialect
impl Clone for SnowflakeDialect
Source§fn clone(&self) -> SnowflakeDialect
fn clone(&self) -> SnowflakeDialect
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SnowflakeDialect
impl Debug for SnowflakeDialect
Source§impl Dialect for SnowflakeDialect
Available on crate feature dialect-snowflake only.
impl Dialect for SnowflakeDialect
Available on crate feature
dialect-snowflake only.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 语句
Source§fn quote_checked(&self, identifier: &str) -> Result<String, DbError>
fn quote_checked(&self, identifier: &str) -> Result<String, DbError>
L-4 修复:带校验的引用标识符 Read more
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:生成批量 upsert 的冲突处理子句(ON CONFLICT / ON DUPLICATE KEY UPDATE) Read more
Source§fn build_lock_clause(&self, lock_type: LockType) -> Option<String>
fn build_lock_clause(&self, lock_type: LockType) -> Option<String>
P2-3:生成行锁子句(TASK-025/026) Read more
Source§fn supports_lock_for_update(&self) -> bool
fn supports_lock_for_update(&self) -> bool
P2-3:该方言是否支持
FOR UPDATE 行锁(TASK-029) Read moreP2-3:该方言是否支持共享锁(TASK-029) Read more
Auto Trait Implementations§
impl Freeze for SnowflakeDialect
impl RefUnwindSafe for SnowflakeDialect
impl Send for SnowflakeDialect
impl Sync for SnowflakeDialect
impl Unpin for SnowflakeDialect
impl UnsafeUnpin for SnowflakeDialect
impl UnwindSafe for SnowflakeDialect
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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