File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed 
wundergraph/src/query_builder/selection Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ use diesel::backend::Backend;
1010use  diesel:: query_dsl:: methods:: LimitDsl ; 
1111#[ cfg( any( feature = "postgres" ,  feature = "sqlite" ,  feature = "mysql" ) ) ]  
1212use  diesel:: query_dsl:: methods:: OffsetDsl ; 
13- 
1413use  juniper:: LookAheadSelection ; 
1514
1615/// A trait abstracting over the different behaviour of limit/offset 
@@ -93,6 +92,12 @@ impl ApplyOffset for diesel::mysql::Mysql {
9392            if  select. argument ( "limit" ) . is_some ( )  { 
9493                Ok ( q) 
9594            }  else  { 
95+                 // Mysql requires a limit clause in front of any offset clause 
96+                 // The documentation proposes the following: 
97+                 // > To retrieve all rows from a certain offset up to the end of the 
98+                 // > result set, you can use some large number for the second parameter. 
99+                 // https://dev.mysql.com/doc/refman/8.0/en/select.html 
100+                 // Therefore we just use i64::MAX as limit here 
96101                Ok ( <_  as  LimitDsl >:: limit ( q,  std:: i64:: MAX ) ) 
97102            } 
98103        }  else  { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments