Skip to content

Commit b0c0ae2

Browse files
committed
Enable new features by default
1 parent 42252d8 commit b0c0ae2

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
@@ -639,6 +639,7 @@ pub trait Dialect: Debug + Any {
639639
/// -- here: qualified with array subscripts
640640
/// INSERT (FOO.ID[1], FOO.NAME[1:12])
641641
/// VALUES (FOO_IMP.ID, UPPER(FOO_IMP.NAME))
642+
/// ```
642643
/// or
643644
/// ```sql
644645
/// MERGE INTO FOO X
@@ -650,10 +651,9 @@ pub trait Dialect: Debug + Any {
650651
/// VALUES (FOO_IMP.ID, UPPER(FOO_IMP.NAME))
651652
/// ```
652653
///
653-
/// The default implementation always returns `false` not allowing the
654-
/// qualifiers.
654+
/// By default, qualifiers are allowed.
655655
fn supports_merge_insert_qualified_columns(&self) -> bool {
656-
false
656+
true
657657
}
658658

659659
/// Returns `true` if the dialect supports specify an INSERT predicate in
@@ -670,13 +670,12 @@ pub trait Dialect: Debug + Any {
670670
/// WHERE NOT FOO_IMP.NAME like '%.IGNORE'
671671
/// ```
672672
///
673-
/// The default implementation always returns `false` indicating no
674-
/// support for the additional predicate.
673+
/// By default, the additional predicate support is enabled.
675674
///
676675
/// See also [Dialect::supports_merge_update_predicate] and
677676
/// [Dialect::supports_merge_update_delete_predicate].
678677
fn supports_merge_insert_predicate(&self) -> bool {
679-
false
678+
true
680679
}
681680

682681
/// Indicates the supports of UPDATE predicates in MERGE
@@ -692,13 +691,12 @@ pub trait Dialect: Debug + Any {
692691
/// WHERE FOO.NAME <> 'pete'
693692
/// ```
694693
///
695-
/// The default implementation always returns false indicating no support
696-
/// for the additional predicate.
694+
/// By default, the additional predicate is enabled.
697695
///
698696
/// See also [Dialect::supports_merge_insert_predicate] and
699697
/// [Dialect::supports_merge_update_delete_predicate].
700698
fn supports_merge_update_predicate(&self) -> bool {
701-
false
699+
true
702700
}
703701

704702
/// Indicates the supports of UPDATE ... DELETEs and associated predicates
@@ -714,13 +712,13 @@ pub trait Dialect: Debug + Any {
714712
/// DELETE WHERE UPPER(FOO.NAME) == FOO.NAME
715713
/// ```
716714
///
717-
/// The default implementation always returns false indicating no support
718-
/// for the `UPDATE ... DELETE` and its associated predicate.
715+
/// By default, the support for the `UPDATE ... DELETE` and its associated
716+
/// predicate is enabled.
719717
///
720718
/// See also [Dialect::supports_merge_insert_predicate] and
721719
/// [Dialect::supports_merge_update_predicate].
722720
fn supports_merge_update_delete_predicate(&self) -> bool {
723-
false
721+
true
724722
}
725723

726724
/// 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)