Skip to content

Refine the 3.0 API surface - #469

Draft
JanJakes wants to merge 10 commits into
trunkfrom
removals
Draft

Refine the 3.0 API surface#469
JanJakes wants to merge 10 commits into
trunkfrom
removals

Conversation

@JanJakes

@JanJakes JanJakes commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

Note

The commits reflect the logical sequence of changes, so the PR is best reviewed by commit.

This prepares the 3.0 API surface by removing obsolete and broken compatibility paths, narrowing implementation APIs, and aligning exposed class names with WP_MySQL_On_SQLite. This includes:

  • Remove the obsolete DATABASE_ENGINE input alias in favor of DB_ENGINE.
  • Remove the broken development-only crosscheck instrumentation from the plugin and release package.
  • Remove test-only access to private legacy driver state.
  • Make self-contained constant maps and self-only translation helpers private.
  • Mark parser, native bridge, connection, schema, diagnostic, and compatibility implementation APIs with WordPress Core-style @access private annotations.
  • Deprecate WP_SQLite_Driver in favor of WP_MySQL_On_SQLite.
  • Remove the obsolete Performance Lab SQLite migration, upgrade UI, and notice compatibility. The migration had been broken since 2023 because it used $wp_filesystem without initializing the WP_Filesystem class.
  • Stop accepting the @pdo global as connection input. Expose the active driver through WP_SQLite_DB::get_driver() and its underlying SQLite PDO through WP_MySQL_On_SQLite::get_sqlite_pdo(), while retaining the global temporarily as a deprecated output alias.
  • Rename WP_SQLite_Driver_Exception to WP_MySQL_On_SQLite_Exception.
  • Rename WP_PDO_Proxy_Statement to WP_MySQL_On_SQLite_Statement.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

🤖 Lexer benchmark

Changes to lexer-related files were detected and triggered a benchmark:

Config Base (QPS) This PR (QPS) Speedup
no JIT 137,803 137,380 1.00×
tracing JIT 262,110 265,319 1.01×

Note: Hosted runners are noisy, and absolute numbers vary. Treat the results with caution and verify them locally.

To reproduce locally:

cd packages/mysql-on-sqlite && composer run bench-lexer

define( 'DB_ENGINE', 'sqlite' );
} elseif ( defined( 'DATABASE_ENGINE' ) ) {
// backwards compatibility with previous versions of the plugin.
define( 'DB_ENGINE', DATABASE_ENGINE );

@JanJakes JanJakes Aug 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Searches: Veloria, GitHub.

This looks safe because the WordPress plugin corpus finds no consumer of this constant. The only other Veloria matches are unrelated YARPP cache-key names. The broader GitHub results are generic identifiers or bundled copies.

Drop the DATABASE_ENGINE input alias now that DB_ENGINE is the supported configuration API.
@JanJakes
JanJakes force-pushed the removals branch 4 times, most recently from ed06848 to aabc865 Compare August 3, 2026 10:57
@JanJakes JanJakes changed the title Remove obsolete compatibility surfaces Refine the 3.0 API surface Aug 3, 2026
);
if ( null !== $pdo ) {
$options['pdo'] = $pdo;
}

@JanJakes JanJakes Aug 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Searches: Veloria, GitHub.

This looks safe because external plugin matches only read the @pdo global after initialization; none assigns it as connection input. This branch still publishes it as a deprecated output alias, so those consumers remain compatible while injection is removed.

<?php

class WP_SQLite_Driver_Exception extends PDOException {
class WP_MySQL_On_SQLite_Exception extends PDOException {

@JanJakes JanJakes Aug 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Searches: Veloria, GitHub.

This looks safe because Veloria finds only this plugin. GitHub results are primarily bundled copies.

*/
class WP_PDO_Proxy_Statement extends PDOStatement {
use WP_PDO_Proxy_Statement_PHP_Compat;
class WP_MySQL_On_SQLite_Statement extends PDOStatement {

@JanJakes JanJakes Aug 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Searches: Veloria, GitHub.

This looks safe because Veloria finds only this plugin, and the GitHub results are bundled copies rather than independent construction or type checks. Consumers receive these objects through the PDOStatement-compatible query API, so no compatibility alias is needed.

Delete the broken development-only MySQL crosscheck path from the runtime plugin and its release contents.
Stop exposing magic access to private driver state and remove the private-method relay that existed only for compatibility tests.

Remove the redundant facade assignment that depended on the magic setter.
Make translation helpers and self-contained constant maps private.
Keep parser, native bridge, connection, schema, and diagnostic plumbing outside the public 3.0 compatibility contract.
Document WP_SQLite_Driver as deprecated in 3.0 with WP_MySQL_On_SQLite as its replacement.
The migration path has been broken since 2023, when direct file deletion was replaced with $wp_filesystem->delete() without initializing the WordPress filesystem. Remove its upgrade handler, UI, and notice compatibility now that the former module is obsolete.
Expose the active MySQL-on-SQLite driver through WP_SQLite_DB and its underlying SQLite PDO through WP_MySQL_On_SQLite.

Stop treating the compatibility global as a connection input. Retain it temporarily as a deprecated output alias while consumers migrate to the explicit accessors.
Align the exception class with the WP_MySQL_On_SQLite API name. Do not retain the obsolete class name because no external runtime usage was found.
Align the concrete statement class with the WP_MySQL_On_SQLite API name and replace the obsolete proxy terminology. Do not retain an alias because public code searches found no external dependency on the old class name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant