Make WordPress Core

Opened 7 months ago

Last modified 8 weeks ago

#57793 new feature request

Add native support for SQLite

Reported by: aristath's profile aristath Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Database Keywords: has-patch
Focuses: performance Cc:

Description (last modified by aristath)

A few months ago, a proposal was published to natively support SQLite in WordPress Core (https://make.wordpress.org/core/2022/09/12/lets-make-wordpress-officially-support-sqlite/).
That proposal outlines a lot of the benefits of supporting SQLite in Core.

The proposal has received a lot of positive feedback, both from the community and the WordPress leadership so this Trac ticket is the next step, to promote collaboration and discussion.

The performance team has been working on an implementation that adds support for SQLite via the SQLite Database Integration plugin (https://wordpress.org/plugins/sqlite-database-integration/). Before being published as a stand-alone plugin, it was implemented as a module in the Performance Lab plugin (https://wordpress.org/plugins/performance-lab/) where it received a lot of user-testing.

Change History (10)

#1 @aristath
7 months ago

  • Description modified (diff)

With the plugin active, all WordPress PHPUnit tests pass (with just a few exceptions that need patching in Core when the featured plugin gets merged, see https://github.com/WordPress/sqlite-database-integration/pull/9#issuecomment-1437018625 for details).

#2 @aristath
7 months ago

  • Description modified (diff)

This ticket was mentioned in PR #3220 on WordPress/wordpress-develop by @aristath.


7 months ago
#3

  • Keywords has-patch added

#4 @swissspidy
7 months ago

In the blog post I see lots of unanswered questions about keeping it as a canonical plugin rather than merging it into core. Given that the post is already a few months old, I'd suggest writing a follow-up post with the latest updates (like the improved security thanks to the new parser implementation, which is pretty neat), which can then be discussed in dev chat as well.

#5 @aristath
7 months ago

Thank you for the feedback @swisspidy!

In the blog post I see lots of unanswered questions about keeping it as a canonical plugin rather than merging it into core.

Using the featured plugin is a great way to allow users to test the implementation, iron-out any issues etc. However, long-term it doesn't make sense to use this as a plugin.
Keeping it as a canonical plugin basically negates most of the SQLite benefits... A plugin can only be installed on an existing site - which would require having a MySQL database.

Given that the post is already a few months old, I'd suggest writing a follow-up post with the latest updates (like the improved security thanks to the new parser implementation, which is pretty neat), which can then be discussed in dev chat as well.

That's a good idea, adding it to my TODO list 👍

Last edited 7 months ago by aristath (previous) (diff)

@zieladam commented on PR #3220:


7 months ago
#6

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.

This ticket was mentioned in Slack in #hosting-community by javier. View the logs.


7 months ago

@aristath commented on PR #3220:


7 months ago
#8

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

sangaman commented on PR #3220:


2 months ago
#9

I'm excited for this. I'd be happy to test this PR on my personal website whenever it's nearing readiness.

#10 @joemcgill
8 weeks ago

  • Milestone changed from Awaiting Review to Future Release

Adding this to the Future Release milestone for consideration once a stronger use case is presented for why this should be in core and not simply continue as a feature plugin.

Note: See TracTickets for help on using tickets.