-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SQLite compatibility to wp db
commands
#234
Comments
@janw-me Currently, a lot of the To support SQLite, we'd need to find a standardized way to act on the SQLite file through the shell, not the WPDB wrapper. |
Removing the |
wp db
commands
If the command detects Edit: I'm actually running into some infinite loop when running tests right now 🤔 Tests just keep hanging and can't be cancelled. Edit 2: Fixing |
OK, now that tests are properly running I have a better picture of things. I am not super familiar with the db command though, so please bear with me. One problem is that most commands (e.g.
The SQLite plugin requires PDO, so we could rely on that too to interact with SQLite |
For this particular scenario, I think we could replicate WordPress' db loading logic inside of WP-CLI (i.e. assume db drop-in/SQLite given specific conditions).
These sound like great Hack Day projects! 😁 |
Yeah we can try that. Could be as simple as:
Might need to load some more files in (2) because the plugin's drop-in calls functions like Caveat: what if the drop-in is not actually for SQLite but for something else? What do we do then? Edit: perhaps just do |
Describe the current, buggy behavior
Several
wp db *
commands don't work with sqlite.SQLite is in testing fase
Describe how other contributors can replicate this bug
wp plugin install performance-lab --activate
wp db drop --yes
the mysql gets dropped,This is fine for this test to make sure you don't read the mysql.
But shouldn't it drop the sqlite file?
wp post list
Shows the hello world
wp db query "SELECT * FROM wp_posts;"
Gives an error.
wp db search 'hello'
Does work, with a warning.
It appears
wp-content/db.php
doesn't get loaded.I don't know when/where it should be included. And if it even would help.
Keep in mind,
FQDBDIR
andFQDB
constants can be set to change the location & filename of the sqlite file.The text was updated successfully, but these errors were encountered: