File tree 1 file changed +6
-1
lines changed
wundergraph/src/query_builder/selection
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;
10
10
use diesel:: query_dsl:: methods:: LimitDsl ;
11
11
#[ cfg( any( feature = "postgres" , feature = "sqlite" , feature = "mysql" ) ) ]
12
12
use diesel:: query_dsl:: methods:: OffsetDsl ;
13
-
14
13
use juniper:: LookAheadSelection ;
15
14
16
15
/// A trait abstracting over the different behaviour of limit/offset
@@ -93,6 +92,12 @@ impl ApplyOffset for diesel::mysql::Mysql {
93
92
if select. argument ( "limit" ) . is_some ( ) {
94
93
Ok ( q)
95
94
} 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
96
101
Ok ( <_ as LimitDsl >:: limit ( q, std:: i64:: MAX ) )
97
102
}
98
103
} else {
You can’t perform that action at this time.
0 commit comments