Closed npapapietro closed 2 years ago
Can you create a PR and put a runnable example under issues/663? It would greatly help us in fixing the bug. And it'd be great if the snippet can be trimmed down a bit more. Is subquery a key factor here?
I'm not sure what's causing it, I'm learning the layout of this repo and attempting to nail it down. It could very well be the subquery component I have here. I added a PR with some unit tests that should capture the bug. The mock test had me going for a minute thinking I was missing something, but the integration test throws the error I was encountering.
Description
When passing a raw sql query to Selector raw and paginating it, the values binded don't get passed down to the methods on paginator.
Steps to Reproduce
Expected Behavior
Pagination runs like
Selector<T>
Actual Behavior
On the
fetch_page
method the erroroperator does not exist: text = bigint
is returned. This is because the values from the actual query aren't present and thelimit
andoffset
are pushed on to the values list and mismatched withSelectStatement.values
For
num_items
andnum_pages
you geterror returned from database: bind message supplies 0 parameters, but prepared statement "sqlx_s_1" requires 1
Reproduces How Often
Every run
Versions
0.7.1
Additional Information
Same behavior on
SelectorRaw::into_json
andSelectorRaw::into_model<T>