Skip to content

Make --dbname and --dbuser optional when SQLite integration is active#219

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-sqlite-compatibility-issue
Draft

Make --dbname and --dbuser optional when SQLite integration is active#219
Copilot wants to merge 2 commits intomainfrom
copilot/fix-sqlite-compatibility-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

wp config create unconditionally requires --dbname and --dbuser, making it impossible to create a config for a SQLite-backed WordPress install without supplying MySQL credentials that will never be used.

Changes

  • Optional synopsis params: --dbname and --dbuser are now [--dbname] / [--dbuser] in the docblock synopsis.
  • SQLite detection: New is_sqlite_integration_active() checks for SQLITE_DB_DROPIN_VERSION in wp-content/db.php (reads first 8 KB only).
  • Conditional validation: When SQLite is not detected, missing --dbname or --dbuser still produces an explicit error — existing MySQL/MariaDB behaviour is unchanged.
  • Skip MySQL check for SQLite: The mysqli connection check is bypassed entirely when SQLite is detected, so --skip-check is not required.
  • New @require-sqlite Behat scenario: Verifies wp config create succeeds without --dbname/--dbuser when the SQLite drop-in is present.
# SQLite install — now works without MySQL credentials
$ wp config create --skip-salts --skip-check
Success: Generated 'wp-config.php' file.

# MySQL install — still errors clearly if params are omitted
$ wp config create --skip-check
Error: Parameter errors:
missing --dbname parameter (Set the database name.)

Copilot AI linked an issue Apr 1, 2026 that may be closed by this pull request
@github-actions github-actions bot added bug command:config-create Related to 'config create' command scope:testing Related to testing state:unconfirmed labels Apr 1, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…n and skip MySQL check for SQLite

Agent-Logs-Url: https://github.com/wp-cli/config-command/sessions/8f9ece6b-b44b-4ac7-87e2-35bad2b2afff

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix SQLite compatibility issue in db creation tests Make --dbname and --dbuser optional when SQLite integration is active Apr 1, 2026
Copilot AI requested a review from swissspidy April 1, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug command:config-create Related to 'config create' command scope:testing Related to testing state:unconfirmed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQLite Compatibility

2 participants