@@ -47,6 +47,14 @@ pub struct TestedDialects {
47
47
}
48
48
49
49
impl TestedDialects {
50
+ /// Create a TestedDialects with default options and the given dialects.
51
+ pub fn new ( dialects : Vec < Box < dyn Dialect > > ) -> Self {
52
+ Self {
53
+ dialects,
54
+ options : None ,
55
+ }
56
+ }
57
+
50
58
fn new_parser < ' a > ( & self , dialect : & ' a dyn Dialect ) -> Parser < ' a > {
51
59
let parser = Parser :: new ( dialect) ;
52
60
if let Some ( options) = & self . options {
@@ -211,24 +219,21 @@ impl TestedDialects {
211
219
212
220
/// Returns all available dialects.
213
221
pub fn all_dialects ( ) -> TestedDialects {
214
- let all_dialects = vec ! [
215
- Box :: new( GenericDialect { } ) as Box <dyn Dialect >,
216
- Box :: new( PostgreSqlDialect { } ) as Box <dyn Dialect >,
217
- Box :: new( MsSqlDialect { } ) as Box <dyn Dialect >,
218
- Box :: new( AnsiDialect { } ) as Box <dyn Dialect >,
219
- Box :: new( SnowflakeDialect { } ) as Box <dyn Dialect >,
220
- Box :: new( HiveDialect { } ) as Box <dyn Dialect >,
221
- Box :: new( RedshiftSqlDialect { } ) as Box <dyn Dialect >,
222
- Box :: new( MySqlDialect { } ) as Box <dyn Dialect >,
223
- Box :: new( BigQueryDialect { } ) as Box <dyn Dialect >,
224
- Box :: new( SQLiteDialect { } ) as Box <dyn Dialect >,
225
- Box :: new( DuckDbDialect { } ) as Box <dyn Dialect >,
226
- Box :: new( DatabricksDialect { } ) as Box <dyn Dialect >,
227
- ] ;
228
- TestedDialects {
229
- dialects : all_dialects,
230
- options : None ,
231
- }
222
+ TestedDialects :: new ( vec ! [
223
+ Box :: new( GenericDialect { } ) ,
224
+ Box :: new( PostgreSqlDialect { } ) ,
225
+ Box :: new( MsSqlDialect { } ) ,
226
+ Box :: new( AnsiDialect { } ) ,
227
+ Box :: new( SnowflakeDialect { } ) ,
228
+ Box :: new( HiveDialect { } ) ,
229
+ Box :: new( RedshiftSqlDialect { } ) ,
230
+ Box :: new( MySqlDialect { } ) ,
231
+ Box :: new( BigQueryDialect { } ) ,
232
+ Box :: new( SQLiteDialect { } ) ,
233
+ Box :: new( DuckDbDialect { } ) ,
234
+ Box :: new( DatabricksDialect { } ) ,
235
+ Box :: new( ClickHouseDialect { } ) ,
236
+ ] )
232
237
}
233
238
234
239
/// Returns all dialects matching the given predicate.
0 commit comments