PluginProbe
SQLite Database Integration / 3.1.0
SQLite Database Integration v3.1.0
3.1.0 3.0.2 3.0.1 trunk 2.1.13 2.1.14 2.1.15 2.1.16 2.2.0 2.2.1 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.17 2.2.18 2.2.19 2.2.2 2.2.20 2.2.21 2.2.22 2.2.23 All 33 releases
sqlite-database-integration / readme.txt

readme.txt in SQLite Database Integration 3.1.0, at readme.txt

258 lines 15.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 === SQLite Database Integration ===
2
3 Contributors: wordpressdotorg, aristath, janjakes, zieladam, berislav.grgicak, bpayton, zaerl
4 Requires at least: 6.4
5 Tested up to: 7.1
6 Requires PHP: 7.2
7 Stable tag: 3.1.0
8 License: GPLv2 or later
9 License URI: https://www.gnu.org/licenses/gpl-2.0.html
10 Tags: sqlite, database
11
12 Run WordPress on SQLite.
13
14 == Description ==
15
16 **Run WordPress on SQLite.**
17
18 The SQLite plugin is a community, feature plugin. The intent is to allow testing an SQLite integration with WordPress and gather feedback, with the goal of eventually landing it in WordPress core.
19
20 The plugin replaces the default MySQL database layer with an SQLite-backed implementation. WordPress continues to use its standard `wpdb` API while the plugin translates and emulates MySQL queries for SQLite.
21
22 = What the plugin provides =
23
24 * **No database server.** Your site's data is stored in a local SQLite database.
25 * **Guided setup.** The installation screen checks for the required PHP extension, write access, and conflicting database drop-ins before enabling SQLite.
26 * **Purpose-built compatibility.** A MySQL parser and emulation layer adapt MySQL syntax and behavior for SQLite.
27 * **Useful diagnostics.** SQLite details appear in Site Health, and Query Monitor is supported.
28
29 **Important:** Enabling SQLite creates a separate, empty database; it does not migrate an existing site. If you enable it on a site that uses MySQL or MariaDB, WordPress will ask you to set up the site again. Disabling the plugin reconnects WordPress to the previous database with its data unchanged. Changes made while using SQLite are not transferred.
30
31 The plugin requires the PDO SQLite PHP extension and SQLite 3.37.0 or newer.
32
33 == Frequently Asked Questions ==
34
35 = What is the purpose of this plugin? =
36
37 The primary purpose of the plugin is to test WordPress with SQLite and gather feedback, with the goal of eventually including the integration in WordPress core.
38
39 Read the original proposal on the [Make WordPress Core blog](https://make.wordpress.org/core/2022/09/12/lets-make-wordpress-officially-support-sqlite/) and the [call for testing](https://make.wordpress.org/core/2022/12/20/help-us-test-the-sqlite-implementation/) for more context.
40
41 = Can I use this plugin on my production site? =
42
43 Yes, but keep reliable backups and make sure SQLite is a good fit for your site's traffic. SQLite supports concurrent reads but allows only one writer at a time, so MySQL or MariaDB may be a better fit for sites with heavy concurrent write traffic. Test your workload, themes, and plugins before switching.
44
45 = Will this plugin migrate my existing site to SQLite? =
46
47 No. Enabling SQLite starts a fresh WordPress installation in a separate database. Your existing MySQL or MariaDB database remains unchanged, but its content is not copied to SQLite.
48
49 Disabling the plugin reconnects WordPress to the previous database. Content created while using SQLite is not transferred back.
50
51 = Where is the SQLite database stored? =
52
53 By default, the SQLite database is stored in a **randomized path** under `WP_CONTENT_DIR . '/database'`. The full path is recorded in `db-path.php` and exposed by the `DB_PATH` constant at runtime.
54
55 For example:
56
57 1. Database path: `WP_CONTENT_DIR . '/database/.ht.020a33c5d9e5407e8e93b43e55abf62e/.ht.sqlite'`
58 2. Recorded in: `WP_CONTENT_DIR . '/database/db-path.php'` as `return __DIR__ . '/...';`
59 3. Exposed by: `DB_PATH`
60
61 The random path makes the database location difficult to guess when it is not otherwise protected. We recommend setting `DB_PATH` to an **explicit, protected path** outside the web root that your web server does not expose.
62
63 Integrations should always read `DB_PATH` after WordPress loads instead of assuming a fixed database path.
64
65 = How can I configure the database location? =
66
67 To properly **secure the SQLite database**, define the `DB_PATH` constant to an **explicit path** that is protected from public web access. An explicit `DB_PATH` value is used as-is without randomization. Define it in `wp-config.php`:
68
69 // Use protected DB path that is not exposed by the web server.
70 define( 'DB_PATH', '/private/wordpress/database.sqlite' );
71
72 **Caution:** An explicit `DB_PATH` must point to a **protected** location that your web server does not expose. Store the database outside the web root and make sure it's protected.
73
74 The value of `DB_PATH` must be an absolute path to the SQLite database file, or `:memory:` for an in-memory SQLite database. The database directory must be writable by PHP. Changing `DB_PATH` selects a different database without moving an existing one.
75
76 = What does the plugin require? =
77
78 In addition to the WordPress and PHP versions listed above, the plugin requires the PDO SQLite PHP extension and SQLite 3.37.0 or newer. The setup screen also needs write access to the `wp-content` directory and will detect conflicting database drop-ins.
79
80 = Where can I submit my plugin feedback? =
81
82 Feedback helps improve the integration. For troubleshooting, questions, suggestions, or feature requests, [open an issue in the SQLite GitHub repository](https://github.com/wordpress/sqlite-database-integration/issues/new).
83
84 = How can I contribute to the plugin? =
85
86 Contributions are welcome through the [SQLite Database Integration repository on GitHub](https://github.com/WordPress/sqlite-database-integration).
87
88 = Does this plugin change how WordPress queries are executed? =
89
90 Yes. The plugin replaces the default MySQL-based database layer with an SQLite-backed implementation. WordPress continues to use the `wpdb` API, while queries are internally adapted to SQLite syntax and behavior.
91
92 == Changelog ==
93
94 = 3.1.0 =
95
96 **SQLite Database Integration 3.1 is here! 🎉**
97
98 This release improves **database storage and configuration** and fixes several MySQL compatibility issues.
99
100 **What's new**
101
102 Version 3.1 improves how WordPress sites store, locate, and protect their SQLite databases. It also fixes SQL behavior and export compatibility:
103
104 * **Randomized database paths:** The default database location is now a randomized directory under `wp-content/database/`, recorded in `wp-content/database/db-path.php`. ([#502](https://github.com/WordPress/sqlite-database-integration/pull/502))
105 * **`DB_PATH`:** Configure the database with one full-path constant, also available at runtime for integrations. ([#512](https://github.com/WordPress/sqlite-database-integration/pull/512))
106 * **SQL compatibility:** Fix `IF()` condition evaluation and make `TRADITIONAL` enable its component SQL modes. ([#518](https://github.com/WordPress/sqlite-database-integration/pull/518), [#509](https://github.com/WordPress/sqlite-database-integration/pull/509))
107 * **WordPress table collations:** Default to `utf8mb4_unicode_520_ci` for new tables created with WordPress's charset settings, improving exports to MariaDB. Existing tables keep their recorded collation. ([#514](https://github.com/WordPress/sqlite-database-integration/pull/514))
108 * **Documentation:** A new plugin README and expanded FAQ explain database storage and secure configuration. ([#520](https://github.com/WordPress/sqlite-database-integration/pull/520))
109
110 For more information about database paths and secure configuration, read the [database storage guide](https://github.com/WordPress/sqlite-database-integration/blob/trunk/packages/plugin-sqlite-database-integration/README.md#database-storage).
111
112 **Upgrading to 3.1**
113
114 Upgrading an existing SQLite site is straightforward:
115
116 1. **Back up** your SQLite database.
117 2. **Update the plugin** to version 3.1.
118
119 Existing `.ht.sqlite` and `.ht.sqlite.php` databases move to the randomized layout automatically unless a database file path is explicitly configured.
120
121 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.
122
123 **Breaking changes**
124
125 Review these changes if you use custom database settings or integrations:
126
127 * **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 read `DB_PATH` after WordPress loads instead of assuming a fixed filename.
128 * **Legacy constants:** `DB_DIR` and `DB_FILE` are now deprecated. They and the previously deprecated `FQDB` and `FQDBDIR` remain supported, but `DB_PATH` takes precedence. Conflicting values trigger warnings.
129 * **Absolute paths:** Relative database file and directory paths are now rejected. `:memory:` remains available for in-memory databases.
130
131 **Thank you**
132
133 Thank you to everyone who contributed, tested, and helped update integrations.
134
135 **Changes since 3.0.2:** [`v3.0.2...v3.1.0`](https://github.com/WordPress/sqlite-database-integration/compare/v3.0.2...v3.1.0)
136
137 = 3.0.2 =
138
139 * Fix schema reconstruction with native numeric results ([#506](https://github.com/WordPress/sqlite-database-integration/pull/506))
140 * Fix lexer edge cases and string handling ([#505](https://github.com/WordPress/sqlite-database-integration/pull/505))
141 * Preserve index prefix lengths and order in `SHOW CREATE TABLE` primary keys ([#500](https://github.com/WordPress/sqlite-database-integration/pull/500))
142 * Align savepoint handling with MySQL semantics ([#496](https://github.com/WordPress/sqlite-database-integration/pull/496))
143
144 = 3.0.1 =
145
146 * Mark the plugin as compatible with WordPress 7.1 ([#497](https://github.com/WordPress/sqlite-database-integration/pull/497))
147 * Fix fresh multisite database setup ([#492](https://github.com/WordPress/sqlite-database-integration/pull/492))
148
149 = 3.0.0 =
150
151 **SQLite Database Integration 3 is here! 🎉**
152
153 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.
154
155 The 3.0 release spans nearly two years of work, featuring [160 pull requests](https://github.com/WordPress/sqlite-database-integration/milestone/3?closed=1) and 1,075 commits from 15 contributors.
156
157 **What's new**
158
159 The new driver advances SQLite support for WordPress, plugins, database tools, and other MySQL-based applications. These improvements include:
160
161 * **New SQL engine:** The pure-PHP lexer and parser provide extensive coverage of the official MySQL grammar.
162 * **Broad query support:** Complex joins, subqueries, CTEs, unions, and other advanced queries are now supported.
163 * **Schema emulation:** WordPress and database tools can query emulated MySQL `INFORMATION_SCHEMA` tables.
164 * **Schema introspection:** `SHOW` and `DESCRIBE` statements provide accurate MySQL-like metadata.
165 * **Improved data handling:** Types, casts, defaults, auto-increment, values, and escaping better match MySQL.
166 * **Refined MySQL semantics:** Better emulation of SQL modes, variables, functions, transactions, and errors.
167 * **Better concurrency:** Write-ahead logging and fewer locks reduce blocking between readers and writers.
168 * **PDO API:** The new driver implements the PDO MySQL API, supporting many MySQL-based tools and applications.
169 * **Extensive testing:** Test suites cover parsing, translation, metadata, concurrency, PDO, and end-to-end workflows.
170
171 For more information about the new driver and its architecture, read the [driver announcement](https://make.wordpress.org/playground/2025/06/13/introducing-a-new-sqlite-driver-for-wordpress/).
172
173 **Modular design**
174
175 The project was redesigned as a set of focused packages, separating the core driver from its WordPress integration:
176
177 * [SQLite Database Integration](https://github.com/WordPress/sqlite-database-integration/tree/v3.0.0/packages/plugin-sqlite-database-integration): The **WordPress plugin** powered by MySQL on SQLite.
178 * [MySQL on SQLite](https://github.com/WordPress/sqlite-database-integration/tree/v3.0.0/packages/mysql-on-sqlite): A standalone **PDO MySQL drop-in** for running MySQL-based PHP applications on SQLite.
179 * [MySQL proxy](https://github.com/WordPress/sqlite-database-integration/tree/v3.0.0/packages/mysql-proxy) (experimental): A **MySQL wire protocol bridge** to PDO-compatible drivers for clients outside PHP.
180
181 This architecture opens the driver to new integrations, applications, and development tools beyond WordPress.
182
183 **Upgrading to 3.0**
184
185 Upgrading an existing SQLite site is straightforward:
186
187 1. **Back up** your SQLite database.
188 2. **Update the plugin** to version 3.0.
189
190 On first connection, the new driver automatically initializes its metadata without changing your tables or content.
191
192 If you used the new driver preview, you can now delete the `WP_SQLITE_AST_DRIVER` flag.
193
194 **Breaking changes**
195
196 Most WordPress sites need no changes. Review the following if you use a custom setup:
197
198 * **New driver:**
199 * The new driver is always used. The legacy driver was removed.
200 * The `WP_SQLITE_AST_DRIVER` feature flag was removed.
201 * **Updated SQLite version requirements:**
202 * SQLite `3.37.0` or newer is required.
203 * The `WP_SQLITE_UNSAFE_ENABLE_UNSUPPORTED_VERSIONS` opt-in enables limited SQLite `3.27.0`–`3.36.x` support.
204 * **`DB_NAME` is required:**
205 * It must be defined and non-empty.
206 * It is used dynamically, independently of the SQLite file name and stored metadata.
207 * **SQLite defaults have changed:**
208 * Journal mode now defaults to [`WAL`](https://sqlite.org/wal.html). Account for `-wal` and `-shm` sidecar files.
209 * Synchronous mode now defaults to [`NORMAL`](https://sqlite.org/pragma.html#pragma_synchronous) in `WAL` mode.
210 * **Updated configuration constants:**
211 * `DATABASE_ENGINE` was removed. Use `DB_ENGINE`.
212 * `DATABASE_TYPE` is deprecated. Use `DB_ENGINE`.
213 * `FQDBDIR` is deprecated. Use `DB_DIR`.
214 * `FQDB` is deprecated. Use `DB_DIR` and `DB_FILE`.
215 * **Updated driver classes:**
216 * `WP_SQLite_Driver` is deprecated. Use `WP_MySQL_On_SQLite`.
217 * `WP_PDO_MySQL_On_SQLite` was replaced by `WP_MySQL_On_SQLite`.
218 * `WP_SQLite_Driver_Exception` was replaced by `WP_MySQL_On_SQLite_Exception`.
219 * `WP_PDO_Proxy_Statement` was replaced by `WP_MySQL_On_SQLite_Statement`.
220 * **Sunsetting `$GLOBALS['@pdo']`:**
221 * Injecting a PDO connection through `$GLOBALS['@pdo']` is no longer supported.
222 * Reading `$GLOBALS['@pdo']` is deprecated. Use `$wpdb->get_driver()->get_sqlite_pdo()`.
223 * **Renamed driver constructor options:**
224 * `pdo` → `sqlite_pdo`.
225 * `journal_mode` → `sqlite_journal_mode`.
226 * `synchronous` → `sqlite_synchronous`.
227
228 **Thank you**
229
230 Thank you to everyone who helped build, test, review, and improve the new driver. Your work made this possible.
231
232 **3.0 milestone:** [160 pull requests](https://github.com/WordPress/sqlite-database-integration/milestone/3?closed=1)
233
234 **Changes since 2.2.23:** [`v2.2.23...v3.0.0`](https://github.com/WordPress/sqlite-database-integration/compare/v2.2.23...v3.0.0)
235
236 = 2.2.23 =
237
238 * Add Query Monitor 4.0 support ([#357](https://github.com/WordPress/sqlite-database-integration/pull/357))
239 * Translate MySQL CONVERT() expressions to SQLite ([#356](https://github.com/WordPress/sqlite-database-integration/pull/356))
240
241 = 2.2.22 =
242
243 * Support INSERT without INTO keyword ([#354](https://github.com/WordPress/sqlite-database-integration/pull/354))
244 * Add tests for MySQL row-level locking clauses ([#342](https://github.com/WordPress/sqlite-database-integration/pull/342))
245 * Improve automated deploy setup.
246
247 = 2.2.21 =
248
249 * Monorepo setup + release automation ([#334](https://github.com/WordPress/sqlite-database-integration/pull/334))
250 * Rework release workflow ([#350](https://github.com/WordPress/sqlite-database-integration/pull/350))
251 * Fix incorrect PHP polyfill implementations ([#338](https://github.com/WordPress/sqlite-database-integration/pull/338))
252
253 == Upgrade Notice ==
254
255 = 3.0.0 =
256
257 Major release with an all-new SQLite driver. Requires SQLite 3.37.0 or newer. Back up your SQLite database before updating.
258