Skip to content

Commit

Permalink
Use value instead of ID for the primary key column
Browse files Browse the repository at this point in the history
  • Loading branch information
2ndkauboy committed Apr 26, 2024
1 parent fd762a7 commit beccc58
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/DB_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -1301,14 +1301,14 @@ public function prefix() {
*
* # Search for a string and print the result as a table
* $ wp db search https://localhost:8889 --format=table
* +------------+--------------+-----------+----+-----------------------------+
* | table | column | key | ID | match |
* +------------+--------------+-----------+----+-----------------------------+
* | wp_options | option_value | option_id | 1 | https://localhost:8889 |
* | wp_options | option_value | option_id | 2 | https://localhost:8889 |
* | wp_posts | guid | ID | 1 | https://localhost:8889/?p=1 |
* | wp_users | user_url | ID | 1 | https://localhost:8889 |
* +------------+--------------+-----------+----+-----------------------------+
* +------------+--------------+-----------+-------+-----------------------------+
* | table | column | key | value | match |
* +------------+--------------+-----------+-------+-----------------------------+
* | wp_options | option_value | option_id | 1 | https://localhost:8889 |
* | wp_options | option_value | option_id | 2 | https://localhost:8889 |
* | wp_posts | guid | ID | 1 | https://localhost:8889/?p=1 |
* | wp_users | user_url | ID | 1 | https://localhost:8889 |
* +------------+--------------+-----------+-------+-----------------------------+
*
* # Search for a string and get only the IDs (only works for a single table)
* $ wp db search https://localhost:8889 wp_options --format=ids
Expand Down Expand Up @@ -1504,7 +1504,7 @@ public function search( $args, $assoc_args ) {
$formatter_args = [
'format' => $format,
];
$formatter_fields = [ 'table', 'column', 'key', 'ID', 'match' ];
$formatter_fields = [ 'table', 'column', 'key', 'value', 'match' ];

if ( $fields ) {
$fields = explode( ',', $assoc_args['fields'] );
Expand Down

0 comments on commit beccc58

Please sign in to comment.