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 a77ddba
Browse filesBrowse the repository at this point in the historyBrowse files
feat(sqlite): harden export escaping and verify imports
Add \" to Export::escape_string for full MySQL backslash escaping and
document the one-statement-per-line guarantee. Wrap Import in a
transaction with rollback, add --refuse-overwrite and --verify-old-host,
and delete a newly created database file (with -wal/-shm/-journal
sidecars) when the import fails. Cover the new behaviors with Behat
scenarios for export escaping, single-line INSERTs, refuse-overwrite,
verification failure, and corrupt serialized data.
Copy file name to clipboardExpand all lines: README.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,13 +20,21 @@ $ wp sqlite import <file>
20
20
<file>
21
21
The path to the MySQL compatible dump file to import. When passing `-` as the file argument, the SQL commands are read from standard input.
22
22
23
+
[--refuse-overwrite]
24
+
Refuse to import when the SQLite database already contains user tables. By default the import merges into the existing database.
25
+
26
+
[--verify-old-host=<host>]
27
+
After loading, fail when any stored value still contains <host>, or when any PHP-serialized value no longer unserializes. The check runs inside the import transaction, so a failure rolls everything back. A failed import into a new database file also deletes that file and its `-wal`, `-shm`, and `-journal` sidecars.
28
+
23
29
[--enable-ast-driver]
24
30
Enables the AST driver for older integration plugin releases. The current driver API is selected automatically.
25
31
26
32
### wp sqlite export
27
33
28
34
Exports an SQLite database to a MySQL compatible file.
29
35
36
+
Each `INSERT` statement is written on a single line: embedded newlines and other special bytes are backslash-escaped (including double quotes), so dumps are safe for line-oriented downstream rewriters as well as for quote-aware parsers.
0 commit comments