-
Notifications
You must be signed in to change notification settings - Fork 55
Added ability to limit number of extracted records #418
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
Conversation
src/Command/ExtractCommand.php
Outdated
@@ -201,6 +201,9 @@ public function extractObjects($folder, array $options = array()) | |||
if (!empty($criteria)) { | |||
$c->where(array($criteria)); | |||
} | |||
if (isset($options['limit']) && is_int($options['limit'])) { | |||
$c->limit($options['limit']); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's something you are happy to consider, maybe we should also allow some sorting options (ie. to only process higher IDs/most recent entries)
Won't this cause excluded objects to get removed from the data directory entirely? Though I guess you're thinking of using this with #417 to have separate data directories, e.g. one for dev and one for prod? |
You are correct on both statement. But there indeed might be drawbacks we did not consider for our use case |
Quick note to let you know this needs more work (at least to fulfill our own requirements) for the "content" type extraction |
Hi @rtripault |
Hi there! Sorry for not commenting! We are happy with it in its current state (hopefully you folks will be too!) |
Thanks a lot, @rtripault ! |
Works great! Nice work as always @rtripault ! |
What does it do ?
Introduced a new
limit
option (only used on extract) to... limit the number of extracted recordsWhy is it needed ?
We are having large projects were all the records are not needed (ie. all blog entries) but only a subset for testing/development purpose. With that limit option, we can safely extract only x records.
Related issue(s)/PR(s)
None found