Skip to content
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

Draft/POC for SQLite support in Core #3220

Draft
wants to merge 46 commits into
base: trunk
Choose a base branch
from
Draft

Conversation

aristath
Copy link
Member

@aristath aristath commented Sep 9, 2022

This is a POC for porting https://wordpress.org/plugins/sqlite-database-integration/ to Core.

Trac ticket: https://core.trac.wordpress.org/ticket/57793


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

aristath added a commit to WordPress/sqlite-database-integration that referenced this pull request Sep 22, 2022
@aristath aristath force-pushed the sqlite branch 2 times, most recently from 981e7a9 to e66cf88 Compare February 23, 2023 09:10
@adamziel
Copy link
Contributor

Update: This PR now translates queries using the MySQL lexer from sqlite-database-integration instead of regular expressions from wp-sqlite-db. The new implementation is a lot safer and more reliable.

@aristath aristath force-pushed the sqlite branch 4 times, most recently from 0593fb1 to 3e2c5a4 Compare March 3, 2023 10:44
@aristath
Copy link
Member Author

aristath commented Mar 3, 2023

I pushed a change as a proof-of-concept for how the installation screen can change.
It's not perfect, but it works and showcases how users can pick a database-type, and what that may look like.
If we don't want to provide users the option to select the db-type via the UI, we can revert the changes in these 2 files:

  • src/wp-admin/setup-config.php
  • wp-config-sample.php

@vadimkantorov
Copy link

vadimkantorov commented Feb 24, 2024

This is really nice also because it would better enable usage of WordPress as a Static Site Generator (as it simplifies operating WordPress using file system only, for both settings and content) for simple content-only WordPress-based blogs

@mrchrisadams
Copy link

hi folks.

I've seen a bit of pushback against SQLite because of both the license it uses, along with their policy for accepting contributions.

If this is still a bone of contention, it's worth knowing that there is a API compatible fork of SQLite called libSQL, which has a code of conduct, and accepts contributions, and uses an OSI approved open source licence.

Here's the manifesto published, explaining why it exists:
https://turso.tech/libsql-manifesto

Here's the project:
https://github.com/tursodatabase/libsql

It's also worth knowing that there is work ongoing to support libSQL in Laravel, and they detail their reasons for doing so too:
laravel/framework#49340

For what it's worth, I'm a fan of SQLite (or SQLite compatible) support making it into Wordpress, so I'm happy to see it in core, as I actually think it could make for a nicer (albeit different) onboarding experience than the famous 5 minute install.

@dingo-d
Copy link
Member

dingo-d commented Apr 5, 2024

Just a quick question, when using the SQLite drop-in, does anybody get errors on wp 6.5 regarding the minimum MySQL version?

@vadimkantorov
Copy link

vadimkantorov commented Jun 20, 2024

This would also lead a way to SSG mode where the content is stored in individual text files (as markdown or json). Writing a script for populating a temp SQLite database from a bunch of text/json files/config files in directories should be quite easy

An important functionality for wpcli should be conversion/export from an existing MySQL Wordpress db to a SQLite db file.
Handrolled hacks are easy to come by, but having a more or a less CI-tested one on large realistic databases would be of great value

@aristath
Copy link
Member Author

An important functionality for wpcli should be conversion from an existing MySQL Wordpress db to a SQLite db file

That's already possible from the terminal, but I completely agree... A WP-CLI script specifically for that task would simplify things a lot 👍

@vadimkantorov
Copy link

vadimkantorov commented Jun 25, 2024

Also, maybe a UI admin button for downloading/exporting existing MySQL db as a SQLite file would be useful (for the cases where we don't have an ssh access to the hosted installation and e.g. only sftp access)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants