Add support for --order, --orderby flags in wp db size command#226
Add support for --order, --orderby flags in wp db size command#226danielbachhuber merged 11 commits intowp-cli:masterfrom
--order, --orderby flags in wp db size command#226Conversation
order, orderby flags in wp db size command
order, orderby flags in wp db size command--order, --orderby flags in wp db size command
danielbachhuber
left a comment
There was a problem hiding this comment.
Great start, @kjohnson !
Overall, it looks really good. Left a few comments with things to be cleaned up. Once they're done, we can 🚢
src/DB_Command.php
Outdated
| $rows[] = [ | ||
| 'Name' => DB_NAME, | ||
| 'Size' => strtoupper( $db_bytes ) . $default_unit, | ||
| '_Bytes' => strtoupper( $db_bytes ), |
There was a problem hiding this comment.
Is there a reason we need to add an underscore to _Bytes? I think it's fine to include in the output...
There was a problem hiding this comment.
The fields are configured above that line to only output Name and Size, so I added an _ to the Bytes temporary key as a convention for visibility. It doesn't change the code either way, so it can be easily removed if you'd like.
There was a problem hiding this comment.
Cool, let's go ahead and remove the underscore. Thanks!
danielbachhuber
left a comment
There was a problem hiding this comment.
Nice work on this, @kjohnson !
|
@kjohnson Any ideas why that test is failing? ^ |
|
@danielbachhuber it looks like the extra posts/pages aren't getting generated. In that test the |
|
@danielbachhuber intermittently it looks like the posts are not being generated. When I run And I run `wp post generate --post_type=page --post_status=draft --count=300`
And I run `wp post list --post_type=page --format=count`
Then STDOUT should be:
"""
300
""" |
|
I've added and removed |
|
Funny that the DB Command is having database related issues during testing. 😅 Are we able to re-run tests on |
Here's the issue: https://core.trac.wordpress.org/ticket/56617 |
|
Ok, yeah, looks like a day earlier and this would have been in the clear 😅 Nice to see that there is a patch ready to go. |
|
These are pretty annoying test failures! I spent some time debugging again today. As far as I can tell, there might be a couple of issues:
I've manually verified your new arguments worked, and marked the tests Appreciate your efforts on this! |
…226) Co-authored-by: Daniel Bachhuber <daniel@bachhuber.co>


Resolves #225 by adding support for the
--orderand--orderbyflags to thewp db sizecommand when displaying table sizes.