Repository navigation
Releases: WordPress/sqlite-database-integration
Release list
v3.1.1
Changelog
- Support date arithmetic with
INTERVALoperators (#539) - Fix
ROLLBACKas the first transaction of a connection (#537) - Fix matching a foreign key reference to a unique key with a different case (#534)
- Fix
FOUND_ROWS()withoutSQL_CALC_FOUND_ROWS(#533) - Fix unique keys and foreign key restore without stringified fetches (#532)
- Fix
CREATE TEMPORARY TABLE IF NOT EXISTSandDROP TEMPORARY TABLEas the first temporary table (#524) - Fix a warning for a foreign key referencing a table with a shorter unique key (#523)
- Fix temporary table lookup without stringified fetches and with a different case (#522)
Contributors
The following contributors merged PRs in this release:
v3.1.0
SQLite Database Integration 3.1 is here! 🎉
This release improves database storage and configuration and fixes several MySQL compatibility issues.
What's new
Version 3.1 improves how WordPress sites store, locate, and protect their SQLite databases. It also fixes SQL behavior and export compatibility:
- Randomized database paths: The default database location is now a randomized directory under
wp-content/database/, recorded inwp-content/database/db-path.php. (#502) DB_PATH: Configure the database with one full-path constant, also available at runtime for integrations. (#512)- SQL compatibility: Fix
IF()condition evaluation and makeTRADITIONALenable its component SQL modes. (#518, #509) - WordPress table collations: Default to
utf8mb4_unicode_520_cifor new tables created with WordPress's charset settings, improving exports to MariaDB. Existing tables keep their recorded collation. (#514) - Documentation: A new plugin README and expanded FAQ explain database storage and secure configuration. (#520)
For more information about database paths and secure configuration, read the database storage guide.
Upgrading to 3.1
Upgrading an existing SQLite site is straightforward:
- Back up your SQLite database.
- Update the plugin to version 3.1.
Existing .ht.sqlite and .ht.sqlite.php databases move to the randomized layout automatically unless a database file path is explicitly configured.
To properly secure the database, set DB_PATH in wp-config.php to an absolute file path outside the web root that your web server does not expose. Its directory must be writable by PHP. Changing DB_PATH does not move an existing database.
Breaking changes
Review these changes if you use custom database settings or integrations:
- Database paths: Default database files now move to randomized paths under
wp-content/database/. Explicitly configured file paths stay unchanged. Integrations, including backup and migration tools, must readDB_PATHafter WordPress loads instead of assuming a fixed filename. - Legacy constants:
DB_DIRandDB_FILEare now deprecated. They and the previously deprecatedFQDBandFQDBDIRremain supported, butDB_PATHtakes precedence. Conflicting values trigger warnings. - Absolute paths: Relative database file and directory paths are now rejected.
:memory:remains available for in-memory databases.
Thank you
Thank you to everyone who contributed, tested, and helped update integrations.
Changes since 3.0.2: v3.0.2...v3.1.0
Contributors
The following contributors merged PRs in this release:
v3.0.2
Changelog
- Fix schema reconstruction with native numeric results (#506)
- Fix lexer edge cases and string handling (#505)
- Preserve index prefix lengths and order in
SHOW CREATE TABLEprimary keys (#500) - Align savepoint handling with MySQL semantics (#496)
Contributors
The following contributors merged PRs in this release:
v3.0.1
v3.0.0
SQLite Database Integration 3 is here! 🎉
This release introduces an all-new SQLite database driver for WordPress, rebuilt from the ground up. Its purpose-built MySQL lexer, parser, and emulation layer deliver broader compatibility, more accurate behavior, and a stronger foundation for future improvements.
The 3.0 release spans nearly two years of work, featuring 160 pull requests and 1,075 commits from 15 contributors.
What's new
The new driver advances SQLite support for WordPress, plugins, database tools, and other MySQL-based applications. These improvements include:
- New SQL engine: The pure-PHP lexer and parser provide extensive coverage of the official MySQL grammar.
- Broad query support: Complex joins, subqueries, CTEs, unions, and other advanced queries are now supported.
- Schema emulation: WordPress and database tools can query emulated MySQL
INFORMATION_SCHEMAtables. - Schema introspection:
SHOWandDESCRIBEstatements provide accurate MySQL-like metadata. - Improved data handling: Types, casts, defaults, auto-increment, values, and escaping better match MySQL.
- Refined MySQL semantics: Better emulation of SQL modes, variables, functions, transactions, and errors.
- Better concurrency: Write-ahead logging and fewer locks reduce blocking between readers and writers.
- PDO API: The new driver implements the PDO MySQL API, supporting many MySQL-based tools and applications.
- Extensive testing: Test suites cover parsing, translation, metadata, concurrency, PDO, and end-to-end workflows.
For more information about the new driver and its architecture, read the driver announcement.
Modular design
The project was redesigned as a set of focused packages, separating the core driver from its WordPress integration:
- SQLite Database Integration: The WordPress plugin powered by MySQL on SQLite.
- MySQL on SQLite: A standalone PDO MySQL drop-in for running MySQL-based PHP applications on SQLite.
- MySQL proxy (experimental): A MySQL wire protocol bridge to PDO-compatible drivers for clients outside PHP.
This architecture opens the driver to new integrations, applications, and development tools beyond WordPress.
Upgrading to 3.0
Upgrading an existing SQLite site is straightforward:
- Back up your SQLite database.
- Update the plugin to version 3.0.
On first connection, the new driver automatically initializes its metadata without changing your tables or content.
If you used the new driver preview, you can now delete the WP_SQLITE_AST_DRIVER flag.
Breaking changes
Most WordPress sites need no changes. Review the following if you use a custom setup:
- New driver:
- The new driver is always used. The legacy driver was removed.
- The
WP_SQLITE_AST_DRIVERfeature flag was removed.
- Updated SQLite version requirements:
- SQLite
3.37.0or newer is required. - The
WP_SQLITE_UNSAFE_ENABLE_UNSUPPORTED_VERSIONSopt-in enables limited SQLite3.27.0–3.36.xsupport.
- SQLite
DB_NAMEis required:- It must be defined and non-empty.
- It is used dynamically, independently of the SQLite file name and stored metadata.
- SQLite defaults have changed:
- Updated configuration constants:
DATABASE_ENGINEwas removed. UseDB_ENGINE.DATABASE_TYPEis deprecated. UseDB_ENGINE.FQDBDIRis deprecated. UseDB_DIR.FQDBis deprecated. UseDB_DIRandDB_FILE.
- Updated driver classes:
WP_SQLite_Driveris deprecated. UseWP_MySQL_On_SQLite.WP_PDO_MySQL_On_SQLitewas replaced byWP_MySQL_On_SQLite.WP_SQLite_Driver_Exceptionwas replaced byWP_MySQL_On_SQLite_Exception.WP_PDO_Proxy_Statementwas replaced byWP_MySQL_On_SQLite_Statement.
- Sunsetting
$GLOBALS['@pdo']:- Injecting a PDO connection through
$GLOBALS['@pdo']is no longer supported. - Reading
$GLOBALS['@pdo']is deprecated. Use$wpdb->get_driver()->get_sqlite_pdo().
- Injecting a PDO connection through
- Renamed driver constructor options:
pdo→sqlite_pdo.journal_mode→sqlite_journal_mode.synchronous→sqlite_synchronous.
Thank you
Thank you to everyone who helped build, test, review, and improve the new driver. Your work made this possible.
@JanJakes, @adamziel, @bgrgicak, @sirreal, @wojtekn, @ashfame, @zaerl, @chloe-pomegranate, @teizz, @chubes4, @johnbillion, @wp-fuse, @desrosj, @gcsecsey, @Nitinrev787
3.0 milestone: 160 pull requests
Changes since 2.2.23: v2.2.23...v3.0.0
v3.0.0-rc.9
Changelog
- Reject invalid
BITcolumn defaults (#487) - Make Composer packages installable (#486)
- Remove
INET_ATON()WordPress dependency (#485) - Restore database version support for older WordPress releases (#484)
- Finalize MySQL-on-SQLite 3.0 refinements (#482)
- Prefix SQLite-specific constructor options (#481)
- Unify emulated MySQL server identity (#479)
- Document the 3.0 driver API (#477)
- Expand PDO API coverage (#471)
- Refine the 3.0 API surface (#469)
- Add
ANSI_QUOTESand SQL mode validation (#452)
Contributors
The following contributors merged PRs in this release:
v3.0.0-rc.8
Changelog
- Preserve aliases in
UPDATE JOINtranslation (#462) - Restrict SQLite installation permissions (#464)
- Improve string escaping (#466)
- Stabilize WordPress E2E tests (#459)
- Address WordPress PHPUnit test fails: charset detection, length validation etc (#331)
- Add Unicode support to the user-defined
REVERSE()function (#453) - Simplify the MySQL-on-SQLite driver API (#449)
- Add WordPress 7.0 compatibility (#450)
Contributors
The following contributors merged PRs in this release: