-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting huge number of rows returns an empty array (paginator) #14
Comments
Resolved using a while loop for myself but that would be a good improvement if the lib could paginate requests itself to retrieve a huge number of rows ! 🥇 $i = 0;
$results = [1];
$lines = [];
while (count($results) !== 0) {
$results = $rm
->createQueryBuilder('purchase.order.line')
->search()
->select(['id', 'name', 'date_planned', 'order_id', 'product_qty', 'qty_received'])
->where($rm->expr()->lt('date_planned', (new DateTime())->format('Y-m-d')))
->orderBy('id')
->setMaxResults('12000')
->setFirstResult($i)
->getQuery()
->getResult();
$i += 12000;
foreach ($results as $result) {
$lines[] = $result;
}
} I'm now getting my +50 000 rows in $lines. |
Hi, thank your for your feedback. We must know what is the limit for rows (or the time limit maybe). I'll try to get an answer from Odoo. |
Le Juste Nombre de lignes 😄 I've tried out different requests on different models : The only thing I know is that it is never the same limit. Are there limits when using XMLRPC ? Hope we can figure this out ! 😃 |
Nice, a paginator will be implemented. ;) Three warnings about your query :
|
Hi !
I'm trying to retrive +50000 rows, as I use this :
I get :
50795
But if I use the getResult() function I got an empty array (if I set maxResults to 100, I'll get 100 rows).
I don't know if there is an issue here or if we need to paginate ourselves the requests & responses. It would be great to have a pagination system in the Query Builder if this is the case.
Thanks !
The text was updated successfully, but these errors were encountered: