Skip to content

Commit 3c1cff3

Browse files
authored
Merge branch 'main' into copilot/fix-sql-mode-checks
2 parents ad062d4 + 2556346 commit 3c1cff3

6 files changed

Lines changed: 75 additions & 51 deletions

File tree

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ jobs:
3636

3737
- name: Install Composer dependencies & cache dependencies
3838
if: steps.check_composer_file.outputs.files_exists == 'true'
39-
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v3
39+
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4
4040
env:
4141
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
42-
with:
43-
# Bust the cache at least once a month - output format: YYYY-MM.
44-
custom-cache-suffix: $(date -u "+%Y-%m")

README.md

Lines changed: 54 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ wp-cli/db-command
33

44
Performs basic database operations using credentials stored in wp-config.php.
55

6-
[![Testing](https://github.com/wp-cli/db-command/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/db-command/actions/workflows/testing.yml)
6+
[![Testing](https://github.com/wp-cli/db-command/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/db-command/actions/workflows/testing.yml) [![Code Coverage](https://codecov.io/gh/wp-cli/db-command/branch/main/graph/badge.svg)](https://codecov.io/gh/wp-cli/db-command/tree/main)
77

88
Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing) | [Support](#support)
99

@@ -648,39 +648,39 @@ Defaults to searching through all tables registered to $wpdb. On multisite, this
648648
- count
649649
---
650650

651-
The percent color codes available are:
652-
653-
| Code | Color
654-
| ---- | -----
655-
| %y | Yellow (dark) (mustard)
656-
| %g | Green (dark)
657-
| %b | Blue (dark)
658-
| %r | Red (dark)
659-
| %m | Magenta (dark)
660-
| %c | Cyan (dark)
661-
| %w | White (dark) (light gray)
662-
| %k | Black
663-
| %Y | Yellow (bright)
664-
| %G | Green (bright)
665-
| %B | Blue (bright)
666-
| %R | Red (bright)
667-
| %M | Magenta (bright)
668-
| %C | Cyan (bright)
669-
| %W | White
670-
| %K | Black (bright) (dark gray)
671-
| %3 | Yellow background (dark) (mustard)
672-
| %2 | Green background (dark)
673-
| %4 | Blue background (dark)
674-
| %1 | Red background (dark)
675-
| %5 | Magenta background (dark)
676-
| %6 | Cyan background (dark)
677-
| %7 | White background (dark) (light gray)
678-
| %0 | Black background
679-
| %8 | Reverse
680-
| %U | Underline
681-
| %F | Blink (unlikely to work)
682-
683-
They can be concatenated. For instance, the default match color of black on a mustard (dark yellow) background `%3%k` can be made black on a bright yellow background with `%Y%0%8`.
651+
The percent color codes available are:
652+
653+
| Code | Color
654+
| ---- | -----
655+
| %y | Yellow (dark) (mustard)
656+
| %g | Green (dark)
657+
| %b | Blue (dark)
658+
| %r | Red (dark)
659+
| %m | Magenta (dark)
660+
| %c | Cyan (dark)
661+
| %w | White (dark) (light gray)
662+
| %k | Black
663+
| %Y | Yellow (bright)
664+
| %G | Green (bright)
665+
| %B | Blue (bright)
666+
| %R | Red (bright)
667+
| %M | Magenta (bright)
668+
| %C | Cyan (bright)
669+
| %W | White
670+
| %K | Black (bright) (dark gray)
671+
| %3 | Yellow background (dark) (mustard)
672+
| %2 | Green background (dark)
673+
| %4 | Blue background (dark)
674+
| %1 | Red background (dark)
675+
| %5 | Magenta background (dark)
676+
| %6 | Cyan background (dark)
677+
| %7 | White background (dark) (light gray)
678+
| %0 | Black background
679+
| %8 | Reverse
680+
| %U | Underline
681+
| %F | Blink (unlikely to work)
682+
683+
They can be concatenated. For instance, the default match color of black on a mustard (dark yellow) background `%3%k` can be made black on a bright yellow background with `%Y%0%8`.
684684

685685
**AVAILABLE FIELDS**
686686

@@ -759,7 +759,22 @@ Defaults to all tables registered to the $wpdb database handler.
759759
List tables based on wildcard search, e.g. 'wp_*_options' or 'wp_post?'.
760760

761761
[--scope=<scope>]
762-
Can be all, global, ms_global, blog, or old tables. Defaults to all.
762+
List tables based on the scope.
763+
764+
- all: returns 'all' and 'global' tables. No old tables are returned.
765+
- blog: returns the blog-level tables for the queried blog.
766+
- global: returns the global tables for the installation, returning multisite tables only on multisite.
767+
- ms_global: returns the multisite global tables, regardless if current installation is multisite.
768+
- old: returns tables which are deprecated.
769+
---
770+
default: all
771+
options:
772+
- all
773+
- blog
774+
- global
775+
- ms_global
776+
- old
777+
---
763778

764779
[--network]
765780
List all the tables in a multisite install.
@@ -1020,6 +1035,10 @@ Want to contribute a new feature? Please first [open a new issue](https://github
10201035

10211036
Once you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See "[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)" for details specific to working on this package locally.
10221037

1038+
### License
1039+
1040+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
1041+
10231042
## Support
10241043

10251044
GitHub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support

codecov.yml

Whitespace-only changes.

features/db-size.feature

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,12 @@ Feature: Display database size
213213
Given a WP install
214214

215215
When I run `wp db size --size_format=b --format=csv`
216-
Then STDOUT should contain:
217-
"""
218-
Name,Size
219-
.ht.sqlite,"
220-
"""
216+
Then STDOUT should match /Name,Size\n\.ht\.sqlite(\.php)?,"/
221217
222218
But STDOUT should not be a number
223219
224220
When I run `wp db size --size_format=b --format=json`
225-
Then STDOUT should contain:
226-
"""
227-
[{"Name":".ht.sqlite","Size":"
228-
"""
221+
Then STDOUT should match /^\[\{"Name":"\.ht\.sqlite(\.php)?","Size":"/
229222

230223
But STDOUT should not be a number
231224

phpcs.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<!--
66
#############################################################################
77
COMMAND LINE ARGUMENTS
8-
For help understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
9-
For help using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage
8+
For help understanding this file: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
9+
For help using PHPCS: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage
1010
#############################################################################
1111
-->
1212

src/DB_Command.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,22 @@ public function import( $args, $assoc_args ) {
957957
* : List tables based on wildcard search, e.g. 'wp_*_options' or 'wp_post?'.
958958
*
959959
* [--scope=<scope>]
960-
* : Can be all, global, ms_global, blog, or old tables. Defaults to all.
960+
* : List tables based on the scope.
961+
*
962+
* - all: returns 'all' and 'global' tables. No old tables are returned.
963+
* - blog: returns the blog-level tables for the queried blog.
964+
* - global: returns the global tables for the installation, returning multisite tables only on multisite.
965+
* - ms_global: returns the multisite global tables, regardless if current installation is multisite.
966+
* - old: returns tables which are deprecated.
967+
* ---
968+
* default: all
969+
* options:
970+
* - all
971+
* - blog
972+
* - global
973+
* - ms_global
974+
* - old
975+
* ---
961976
*
962977
* [--network]
963978
* : List all the tables in a multisite install.

0 commit comments

Comments
 (0)