WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 24185d1

Browse files
committed
Enable new features by default
1 parent 0547fe8 commit 24185d1

File tree

4 files changed

+43
-34
lines changed

4 files changed

+43
-34
lines changed

src/dialect/generic.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -195,20 +195,4 @@ impl Dialect for GenericDialect {
195195
fn supports_interval_options(&self) -> bool {
196196
true
197197
}
198-
199-
fn supports_merge_insert_qualified_columns(&self) -> bool {
200-
true
201-
}
202-
203-
fn supports_merge_insert_predicate(&self) -> bool {
204-
true
205-
}
206-
207-
fn supports_merge_update_predicate(&self) -> bool {
208-
true
209-
}
210-
211-
fn supports_merge_update_delete_predicate(&self) -> bool {
212-
true
213-
}
214198
}

src/dialect/mod.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ pub trait Dialect: Debug + Any {
641641
/// -- here: qualified with array subscripts
642642
/// INSERT (FOO.ID[1], FOO.NAME[1:12])
643643
/// VALUES (FOO_IMP.ID, UPPER(FOO_IMP.NAME))
644+
/// ```
644645
/// or
645646
/// ```sql
646647
/// MERGE INTO FOO X
@@ -652,10 +653,9 @@ pub trait Dialect: Debug + Any {
652653
/// VALUES (FOO_IMP.ID, UPPER(FOO_IMP.NAME))
653654
/// ```
654655
///
655-
/// The default implementation always returns `false` not allowing the
656-
/// qualifiers.
656+
/// By default, qualifiers are allowed.
657657
fn supports_merge_insert_qualified_columns(&self) -> bool {
658-
false
658+
true
659659
}
660660

661661
/// Returns `true` if the dialect supports specify an INSERT predicate in
@@ -672,13 +672,12 @@ pub trait Dialect: Debug + Any {
672672
/// WHERE NOT FOO_IMP.NAME like '%.IGNORE'
673673
/// ```
674674
///
675-
/// The default implementation always returns `false` indicating no
676-
/// support for the additional predicate.
675+
/// By default, the additional predicate support is enabled.
677676
///
678677
/// See also [Dialect::supports_merge_update_predicate] and
679678
/// [Dialect::supports_merge_update_delete_predicate].
680679
fn supports_merge_insert_predicate(&self) -> bool {
681-
false
680+
true
682681
}
683682

684683
/// Indicates the supports of UPDATE predicates in MERGE
@@ -694,13 +693,12 @@ pub trait Dialect: Debug + Any {
694693
/// WHERE FOO.NAME <> 'pete'
695694
/// ```
696695
///
697-
/// The default implementation always returns false indicating no support
698-
/// for the additional predicate.
696+
/// By default, the additional predicate is enabled.
699697
///
700698
/// See also [Dialect::supports_merge_insert_predicate] and
701699
/// [Dialect::supports_merge_update_delete_predicate].
702700
fn supports_merge_update_predicate(&self) -> bool {
703-
false
701+
true
704702
}
705703

706704
/// Indicates the supports of UPDATE ... DELETEs and associated predicates
@@ -716,13 +714,13 @@ pub trait Dialect: Debug + Any {
716714
/// DELETE WHERE UPPER(FOO.NAME) == FOO.NAME
717715
/// ```
718716
///
719-
/// The default implementation always returns false indicating no support
720-
/// for the `UPDATE ... DELETE` and its associated predicate.
717+
/// By default, the support for the `UPDATE ... DELETE` and its associated
718+
/// predicate is enabled.
721719
///
722720
/// See also [Dialect::supports_merge_insert_predicate] and
723721
/// [Dialect::supports_merge_update_predicate].
724722
fn supports_merge_update_delete_predicate(&self) -> bool {
725-
false
723+
true
726724
}
727725

728726
/// Dialect-specific infix parser override

src/dialect/mssql.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,26 @@ impl Dialect for MsSqlDialect {
123123
true
124124
}
125125

126+
/// Set <https://learn.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql>
127+
fn supports_merge_insert_predicate(&self) -> bool {
128+
false
129+
}
130+
131+
/// Set <https://learn.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql>
132+
fn supports_merge_insert_qualified_columns(&self) -> bool {
133+
false
134+
}
135+
136+
/// Set <https://learn.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql>
137+
fn supports_merge_update_delete_predicate(&self) -> bool {
138+
false
139+
}
140+
141+
/// Set <https://learn.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql>
142+
fn supports_merge_update_predicate(&self) -> bool {
143+
false
144+
}
145+
126146
/// See <https://learn.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles>
127147
fn get_reserved_grantees_types(&self) -> &[GranteesType] {
128148
&[GranteesType::Public]

src/dialect/postgresql.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,18 @@ impl Dialect for PostgreSqlDialect {
281281
true
282282
}
283283

284-
/// [Postgres] supports column names with a subfield name or an array
285-
/// subscript in the MERGE INSERT column lists.
286-
///
287-
/// [Postgres]: https://www.postgresql.org/docs/current/sql-merge.html
288-
fn supports_merge_insert_qualified_columns(&self) -> bool {
289-
true
284+
/// See <https://www.postgresql.org/docs/current/sql-merge.html>
285+
fn supports_merge_insert_predicate(&self) -> bool {
286+
false
287+
}
288+
289+
/// See <https://www.postgresql.org/docs/current/sql-merge.html>
290+
fn supports_merge_update_delete_predicate(&self) -> bool {
291+
false
292+
}
293+
294+
/// See <https://www.postgresql.org/docs/current/sql-merge.html>
295+
fn supports_merge_update_predicate(&self) -> bool {
296+
false
290297
}
291298
}

0 commit comments

Comments
 (0)