You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5448bad
Browse filesBrowse the repository at this point in the historyBrowse files
Drop support for SQLite Database Integration below 3.0
The plugin loader now requires version 3.0 or higher and fails with a
clear error for older releases, then loads the plugin through its
wp-includes/database/load.php entry point. The legacy translator, the
old AST wrapper and the manual class-by-class fallbacks are removed.
The driver factory always constructs WP_MySQL_On_SQLite. Import, Export
and Tables drop their legacy result handling, sorting and internal
table filtering, since the 3.0 driver handles those. The
--enable-ast-driver flag is kept as a deprecated no-op for backward
compatibility with existing callers and now emits a warning.
Behat scenarios that used the flag run through the normal path, and a
new scenario covers the deprecation warning.
Copy file name to clipboardExpand all lines: AGENTS.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,34 +11,34 @@ Imports a MySQL dump file into the SQLite database. Parses SQL statements using
11
11
**Parameters:**
12
12
13
13
-`<file>` (required), Path to the SQL dump file. Use `-` to read from STDIN.
14
-
-`[--enable-ast-driver]`Enable the AST driver on older integration plugin releases. The current `WP_MySQL_On_SQLite` API is selected automatically when available.
14
+
-`[--enable-ast-driver]`Deprecated; accepted as a no-op for backward compatibility.
15
15
16
16
### `wp sqlite export [<file>]`
17
17
18
-
Exports the SQLite database to a MySQL-compatible SQL dump file. Generates `DROP TABLE IF EXISTS`, `CREATE TABLE`, and `INSERT INTO` statements for each table. Automatically excludes internal SQLite system tables (`_mysql_data_types_cache`, `sqlite_master`, `sqlite_sequence`, `_wp_sqlite_*`).
18
+
Exports the SQLite database to a MySQL-compatible SQL dump file. Generates `DROP TABLE IF EXISTS`, `CREATE TABLE`, and `INSERT INTO` statements for each table. Internal SQLite system tables are never included; the driver's `SHOW TABLES` already excludes them.
19
19
20
20
**Parameters:**
21
21
22
22
-`[<file>]` (optional), Output file path. Use `-` to write to STDOUT. Defaults to `{Y-m-d}-{random-hash}.sql`.
23
23
-`[--tables=<tables>]` Comma-separated list of tables to include. If omitted, all tables are exported.
24
24
-`[--exclude_tables=<tables>]` Comma-separated list of tables to skip.
25
25
-`[--porcelain]` Output only the filename (for scripting).
26
-
-`[--enable-ast-driver]`Enable the AST driver on older integration plugin releases.
26
+
-`[--enable-ast-driver]`Deprecated; accepted as a no-op for backward compatibility.
27
27
28
28
### `wp sqlite tables`
29
29
30
-
Lists all user tables in the SQLite database, excluding internal/system tables. With the legacy driver, results are sorted alphabetically.
30
+
Lists all user tables in the SQLite database, excluding internal/system tables.
31
31
32
32
**Parameters:**
33
33
34
34
-`[--format=<format>]` Output format: `list` (default, one table per line), `csv`, or `json`.
35
-
-`[--enable-ast-driver]`Enable the AST driver on older integration plugin releases.
35
+
-`[--enable-ast-driver]`Deprecated; accepted as a no-op for backward compatibility.
- WordPress SQLite Database Integration plugin, translation layer between MySQL queries and SQLite
41
-
- The PDO-based `WP_MySQL_On_SQLite` API is selected automatically when available; `WP_SQLite_Translator` and `WP_SQLite_Driver` remain as compatibility fallbacks for older integration plugin releases
41
+
- The PDO-based `WP_MySQL_On_SQLite` API (SQLite Database Integration 3.0 or higher) is the only supported driver API
-`command.php` is the entry point, it registers `wp sqlite` as a WP-CLI command pointing to `SQLite_Command`
106
106
-`SQLite_Command` delegates to `Import`, `Export`, and `Tables` classes
107
107
-`SQLiteDatabaseIntegrationLoader::load_plugin()` bootstraps the WordPress SQLite Database Integration plugin, which MUST be loaded before any database operations
108
-
-`SQLiteDriverFactory::create_driver()` creates the PDO-based `WP_MySQL_On_SQLite` driver when the class is available, with compatibility fallbacks for older integration plugin versions and the legacy translator
108
+
-`SQLiteDriverFactory::create_driver()` creates the PDO-based `WP_MySQL_On_SQLite` driver
109
109
- The import parser (`Import::parse_statements()`) is a streaming SQL parser using PHP generators, it handles quotes, comments, escape sequences, and multi-line statements character by character
110
110
111
111
## Common Pitfalls
112
112
113
113
-**MUST load the SQLite plugin first:** All database operations require `SQLiteDatabaseIntegrationLoader::load_plugin()` to be called before creating a driver. The driver depends on classes from the WordPress SQLite Database Integration plugin.
114
-
-**Multiple driver APIs:** Always use `SQLiteDriverFactory::create_driver()`. It selects the PDO-based `WP_MySQL_On_SQLite`API when available and preserves compatibility with older AST drivers and the legacy translator.
114
+
-**Driver API:** Always use `SQLiteDriverFactory::create_driver()`. It returns the PDO-based `WP_MySQL_On_SQLite`driver; SQLite Database Integration 3.0 or higher is required.
115
115
-**SQL parser edge cases:** The `Import::parse_statements()` method handles escape sequences, nested quotes, and multi-line comments manually. Changes to this parser MUST be tested with the existing Behat scenarios in `features/sqlite-import.feature`.
116
116
-**Encoding handling:** Import attempts UTF-8 conversion as a fallback when queries fail. This is intentional error recovery, not a bug.
117
117
-**`@when after_wp_config_load`:** All command methods use this WP-CLI hook annotation. New commands MUST include it to ensure WordPress config is loaded before execution.
118
-
-**PHPCS inline suppressions:** The codebase uses `@phpcs:disable` / `@phpcs:enable` comments around `define('WP_SQLITE_AST_DRIVER')` because the constant name doesn't follow the project prefix convention. This is intentional.
0 commit comments