Skip to content

Commit e2c502e

Browse files
committed
Show the Extra column in wp db columns on SQLite
`columns()` dropped `Extra` from the output on SQLite because the old SQLite drop-in did not return that field from `SHOW COLUMNS`. The MySQL-on-SQLite driver in sqlite-database-integration 3.0 returns the full MySQL-compatible column set, so the workaround now hides information that is available, notably `auto_increment`. With `Extra` restored, the SQLite variant of the `db columns` scenario expects exactly what the MySQL variant does, so drop the duplicate. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MXbmdB7hvQ2jwEe64h6s5K
1 parent 2d2e057 commit e2c502e

2 files changed

Lines changed: 0 additions & 17 deletions

File tree

‎features/db-columns.feature‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Feature: Display information about a given table.
4141
Couldn't find any tables matching: wp_foobar
4242
"""
4343

44-
@require-mysql-or-mariadb
4544
Scenario: Display information about a non default WordPress table
4645
Given a WP install
4746
And I run `wp db query "CREATE TABLE not_wp ( date DATE NOT NULL, awesome_stuff TEXT, PRIMARY KEY (date) );;"`
@@ -51,15 +50,3 @@ Feature: Display information about a given table.
5150
| Field | Type | Null | Key | Default | Extra |
5251
| date | date | NO | PRI | | |
5352
| awesome_stuff | text | YES | | | |
54-
55-
@require-sqlite
56-
Scenario: Display information about a non default WordPress table
57-
Given a WP install
58-
And I run `wp db query "CREATE TABLE not_wp ( date DATE NOT NULL, awesome_stuff TEXT, PRIMARY KEY (date) );;"`
59-
60-
When I try `wp db columns not_wp`
61-
# The `Extra` column is left out because `wp db columns` omits it on SQLite.
62-
Then STDOUT should be a table containing rows:
63-
| Field | Type | Null | Key | Default |
64-
| date | date | NO | PRI | |
65-
| awesome_stuff | text | YES | | |

‎src/DB_Command.php‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,10 +1942,6 @@ public function columns( $args, $assoc_args ) {
19421942

19431943
$formatter_fields = [ 'Field', 'Type', 'Null', 'Key', 'Default', 'Extra' ];
19441944

1945-
if ( $this->is_sqlite() ) {
1946-
$formatter_fields = [ 'Field', 'Type', 'Null', 'Key', 'Default' ];
1947-
}
1948-
19491945
$formatter_args = [
19501946
'format' => $format,
19511947
];

0 commit comments

Comments
 (0)