Simplify the MySQL-on-SQLite driver API#449
Merged
Merged
Conversation
JanJakes
force-pushed
the
simplify-api
branch
2 times, most recently
from
July 15, 2026 07:49
1bc9c2a to
30281b8
Compare
This was referenced Jul 15, 2026
JanJakes
marked this pull request as ready for review
July 15, 2026 08:08
13 tasks
JanJakes
force-pushed
the
simplify-api
branch
3 times, most recently
from
July 15, 2026 14:12
edf6971 to
23dea85
Compare
Migrate the WordPress integration, MySQL proxy, tools, and tests to the PDO-style driver constructor and statement API.
Rename WP_PDO_MySQL_On_SQLite to WP_MySQL_On_SQLite and align the implementation and test filenames with the public class name.
adamziel
approved these changes
Jul 15, 2026
batonac
added a commit
to Avunu/sqlite-database-integration
that referenced
this pull request
Jul 17, 2026
Bring in the upstream 3.0.0-rc.7 release and reconcile it with the Cloudflare D1 backend. The notable upstream changes are the driver API simplification (WordPress#449), WordPress 7.0 compatibility (WordPress#450), and journal mode preservation in the driver wrapper. Reconciliation: - Engine class: upstream renamed WP_PDO_MySQL_On_SQLite to WP_MySQL_On_SQLite (class-wp-pdo-mysql-on-sqlite.php -> class-wp-mysql-on-sqlite.php). The D1 connection injection is re-applied on top of the renamed, simplified API. Journal mode is preserved for D1 by reusing the injected connection directly rather than reading PRAGMA journal_mode off it. - Driver test suites: upstream refactored the driver suites to exercise the WP_MySQL_On_SQLite PDO engine directly (was the WP_SQLite_Driver facade). The D1 backend switching is adapted accordingly: wp_sqlite_tests_create_pdo_engine() now exposes the raw SQLite handle, and the D1 skip-list keys follow the renamed WP_MySQL_On_SQLite_Tests class. WP_SQLite_Driver_No_UDF_Tests is renamed to WP_MySQL_On_SQLite_No_UDF_Tests for consistency, and the hardcoded test paths in the D1 and upstream-merge-check workflows are updated. - D1 wpdb drop-in: WP_D1_DB now constructs WP_MySQL_On_SQLite directly, matching upstream's rewritten WP_SQLite_DB, which routes results through PDO statements instead of the legacy facade return values. Verified with the default and D1 backend test suites and PHPCS. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Use the PDO-compatible
WP_MySQL_On_SQLiteclass directly in both the WordPress plugin and MySQL proxy, while retainingWP_SQLite_Drivertemporarily for backward compatibility. This includes:WP_PDO_MySQL_On_SQLitetoWP_MySQL_On_SQLiteand align implementation, test, tooling, and CI.PDOStatementquery API.This should be reviewed and merged together with Automattic/wp-cli-sqlite-command#33.
Motivation
Using the PDO-compatible driver directly makes it the primary public entry point with a clear, PDO-defined API. The legacy
WP_SQLite_Driverconstructor and result API remain available only as a temporary backward-compatibility layer.Developer impact
The
WP_SQLite_DriverAPI remains available for backward compatibility, but new consumers should constructWP_MySQL_On_SQLitewith its DSN and options, and consumequery()results asPDOStatementobjects. Consumers usingWP_PDO_MySQL_On_SQLitemust update the class name toWP_MySQL_On_SQLite.