wp-cli / db-command

Performs basic database operations using credentials stored in wp-config.php.
MIT License
71 stars 59 forks source link

Refactor DB command file #160

Closed schlessera closed 2 years ago

schlessera commented 4 years ago

The way options to the underlying mysql* tools are currently handled is extremely inconsistent.

This is a first try at making everything more consistent and ensuring that all tools can accept all allowed options.

ChrisWiegman commented 4 years ago

Most of the test failures look to be due to changing the command output by inserting the host, database, user and password params into the command. Updating the test snapshots should be acceptable accordingly. That said, do we need to be passing those params through in such a manner? I'm not sure why these items have changed from what was being done before.

schlessera commented 4 years ago

I'm not sure why these items have changed from what was being done before.

The goal with the refactor is to normalize the way DB settings are handled and make sure all commands behave in the same way, and this across all environments.

I would think that if passing settings like the user and host explicitly fails, that I'm missing something and I'm not using the correct settings.

danielbachhuber commented 2 years ago

Proceeding with https://github.com/wp-cli/wp-cli/issues/5594 for this repository. I've captured this PR to https://gist.github.com/danielbachhuber/02870103195330ca2789ff8aa7b5774a in case this PR is auto-closed or broken in some way.