@@ -57,8 +57,8 @@ impl<Combinator, Rule, Source, Rhs> CombinationClause<Combinator, Rule, Source,
57
57
CombinationClause {
58
58
combinator,
59
59
duplicate_rule,
60
- source : ParenthesisWrapper ( source) ,
61
- rhs : ParenthesisWrapper ( rhs) ,
60
+ source : ParenthesisWrapper { inner : source } ,
61
+ rhs : ParenthesisWrapper { inner : rhs } ,
62
62
order : NoOrderClause ,
63
63
limit_offset : LimitOffsetClause {
64
64
limit_clause : NoLimitClause ,
@@ -357,7 +357,15 @@ pub trait SupportsCombinationClause<Combinator, Rule> {}
357
357
358
358
#[ derive( Debug , Copy , Clone , QueryId ) ]
359
359
/// Wrapper used to wrap rhs sql in parenthesis when supported by backend
360
- pub struct ParenthesisWrapper < T > ( T ) ;
360
+ #[ diesel_derives:: __diesel_public_if(
361
+ feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes" ,
362
+ public_fields( inner)
363
+ ) ]
364
+ pub struct ParenthesisWrapper < T > {
365
+ /// the inner parenthesis definition
366
+ #[ allow( dead_code) ]
367
+ inner : T ,
368
+ }
361
369
362
370
#[ cfg( feature = "postgres_backend" ) ]
363
371
mod postgres {
@@ -367,7 +375,7 @@ mod postgres {
367
375
impl < T : QueryFragment < Pg > > QueryFragment < Pg > for ParenthesisWrapper < T > {
368
376
fn walk_ast < ' b > ( & ' b self , mut out : AstPass < ' _ , ' b , Pg > ) -> QueryResult < ( ) > {
369
377
out. push_sql ( "(" ) ;
370
- self . 0 . walk_ast ( out. reborrow ( ) ) ?;
378
+ self . inner . walk_ast ( out. reborrow ( ) ) ?;
371
379
out. push_sql ( ")" ) ;
372
380
Ok ( ( ) )
373
381
}
@@ -389,7 +397,7 @@ mod mysql {
389
397
impl < T : QueryFragment < Mysql > > QueryFragment < Mysql > for ParenthesisWrapper < T > {
390
398
fn walk_ast < ' b > ( & ' b self , mut out : AstPass < ' _ , ' b , Mysql > ) -> QueryResult < ( ) > {
391
399
out. push_sql ( "(" ) ;
392
- self . 0 . walk_ast ( out. reborrow ( ) ) ?;
400
+ self . inner . walk_ast ( out. reborrow ( ) ) ?;
393
401
out. push_sql ( ")" ) ;
394
402
Ok ( ( ) )
395
403
}
@@ -410,7 +418,7 @@ mod sqlite {
410
418
// we can emulate this by construct a fake outer
411
419
// SELECT * FROM (inner_query) statement
412
420
out. push_sql ( "SELECT * FROM (" ) ;
413
- self . 0 . walk_ast ( out. reborrow ( ) ) ?;
421
+ self . inner . walk_ast ( out. reborrow ( ) ) ?;
414
422
out. push_sql ( ")" ) ;
415
423
Ok ( ( ) )
416
424
}
0 commit comments