Remove legacy SQLite driver and WP_SQLITE_AST_DRIVER feature flag#358
Draft
Remove legacy SQLite driver and WP_SQLITE_AST_DRIVER feature flag#358
Conversation
|
This is amazing! are we finally moving to the new driver as default? |
|
+1 to this! Would solve a problem for me when using https://github.com/Automattic/studio for local dev Thanks for your efforts! |
aff0359 to
283fb3d
Compare
283fb3d to
eaecbf3
Compare
Remove the legacy, token-based MySQL-to-SQLite translator and its supporting files. The new AST-based driver fully replaces it. Removed files: - class-wp-sqlite-translator.php - class-wp-sqlite-lexer.php - class-wp-sqlite-query-rewriter.php - class-wp-sqlite-token.php - class-wp-sqlite-pdo-user-defined-functions.php - php-polyfills.php
Remove test files that tested the legacy translator, along with the test bootstrap, schema helper, and root phpunit.xml.dist. The new driver tests live in packages/mysql-on-sqlite/. Removed files: - tests/WP_SQLite_Translator_Tests.php - tests/WP_SQLite_Query_Tests.php - tests/WP_SQLite_Metadata_Tests.php - tests/WP_SQLite_Query_RewriterTests.php - tests/WP_SQLite_PDO_User_Defined_Functions_Tests.php - tests/bootstrap.php - tests/wp-sqlite-schema.php - phpunit.xml.dist
The AST-based driver is now the only driver. Remove all conditional logic that branched between the new and legacy driver: - db.php: Always load the new driver. - class-wp-sqlite-db.php: Remove WP_SQLite_Translator instanceof checks, simplify all methods to use WP_SQLite_Driver directly. - install-functions.php: Always use WP_SQLite_Driver. - admin-page.php: Remove "(AST)" suffix from admin bar. - constants.php: Remove WP_SQLITE_AST_DRIVER env var handling. - wp-setup.sh: Remove WP_SQLITE_AST_DRIVER env vars from Docker. - wp-mysql-proxy.php: Remove WP_SQLITE_AST_DRIVER define. - phpcs.xml.dist: Remove legacy translator exclusion.
Remove the "New and old driver" section and update the commands section to remove legacy driver test commands.
Remove the "Run PHPUnit tests for the legacy driver" step that ran root-level phpunit.xml.dist (now deleted). Also remove the unused phpunit-config input parameter and PHPUNIT_CONFIG env var that were only needed to switch between driver configs.
eaecbf3 to
68d63c3
Compare
The filter-based fallback to 'database_name_here' was added to ease early adoption of the new AST-based driver in projects that didn't define DB_NAME. With the legacy driver removed, simplify to a plain ternary — matching how WPDB itself handles the constant.
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
Remove the legacy, token-based MySQL-to-SQLite translator and the
WP_SQLITE_AST_DRIVERfeature flag. The AST-based driver is now the only driver.Changes
phpunit.xml.distandcomposer.jsontest command.WP_SQLITE_AST_DRIVERconditionals andWP_SQLite_Translatorbranches fromclass-wp-sqlite-db.php,admin-page.php,constants.php,wp-mysql-proxy.php, andphpcs.xml.dist.phpunit-configworkflow parameter.AGENTS.mdto reflect the removal.Test plan