Support --limit option in entity:delete command
Is your feature request related to a problem? Please describe. I have similar that already described her https://github.com/drush-ops/drush/issues/5784.
On the website with Drupal Commerce I have >5K commerce_order entities, I need to delete ALL of them, and got memory_limit error (with memory_limit=-1 in php.ini) for a command: drush entity:delete commerce_order
Describe the solution you'd like
I think we can have a little improvement for the entity:delete command and use a little trick to delete entities with bash loop.
I mean run command like:
i="0"; while [ $i -lt 100 ]; do $DRUSH entity:delete commerce_order --limit=500; i=$[$i+1]; done
Describe alternatives you've considered I've tried to execute drupal_static_reset() function after each drush batch iteration and it not helped, still have memory leaks.
Additional context Will provide a PR a little bit later.
PR is added, could somebody check, please?
The https://github.com/drush-ops/drush/pull/6008 PR is merged, so we can close the issue, thank you!
Thanks for creating this new feature @tibezh, it's so great to see the Drupal and Drush eco-system constantly improving.