Skip to content

Try refactor wp db query --defaults handling - #285

Closed
lkraav wants to merge 9 commits into
wp-cli:mainfrom
lkraav:copilot/fix-1
Closed

Try refactor wp db query --defaults handling#285
lkraav wants to merge 9 commits into
wp-cli:mainfrom
lkraav:copilot/fix-1

Conversation

@lkraav

@lkraav lkraav commented Jun 26, 2025

Copy link
Copy Markdown

Try fix #237

Code change is all Copilot.

I reviewed it for general sanity, but I simply don't know enough wp db internals to know whether this direction is where we want to go.

But I'll file this anyway to get movement and directional discussion going.

I feel like currently wp db query just doing --no-defaults basically hard-coded is overly naive for many real world use cases, and needs to be refactored no matter what. If you can't even connect to remote SSL-secured databases, I'm not sure how we can ignore this in 2025.

My Copilot strategy session can be reviewed at lkraav#2

EDIT I've now also tested it, and this PR does make at least --defaults and/or --ssl-verify-server-cert work.

Copilot AI and others added 3 commits June 26, 2025 15:33
Co-authored-by: lkraav <147228+lkraav@users.noreply.github.com>
- Replace empty foreach loop in get_current_sql_modes() with proper MySQL argument preservation using get_mysql_args()
- Add ssl-verify-server-cert to allowed MySQL options list
- Add test case to verify connection arguments are preserved during SQL mode discovery
- Fixes issue where connection flags like --ssl-verify-server-cert were lost during SQL mode discovery

Co-authored-by: lkraav <147228+lkraav@users.noreply.github.com>
@lkraav
lkraav requested a review from a team as a code owner June 26, 2025 18:26
@github-actions github-actions Bot added command:db-query Related to 'db query' command help-wanted Extra attention is needed scope:testing Related to testing labels Dec 22, 2025
@swissspidy swissspidy changed the title Try refactor wp db query --defaults handling, fix #237 Try refactor wp db query --defaults handling Jan 21, 2026

This comment was marked as resolved.

swissspidy and others added 4 commits January 21, 2026 20:20
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@schlessera

Copy link
Copy Markdown
Member

Closed in favor of #333

@schlessera schlessera closed this Jul 21, 2026
@schlessera

Copy link
Copy Markdown
Member

Thanks for the PR, @lkraav, even if we could not merge it. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:db-query Related to 'db query' command help-wanted Extra attention is needed scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

query with "--default"-flag fails when discovering the SQL mode

5 participants