Bug description
sqlite3.Connection.iterdump() emits INSERT statements for a virtual table's
own rows in addition to its schema. Those rows live in the shadow tables (which
are dumped separately), and on restore they run before the virtual table module
is instantiated, so restoring the dump fails:
import sqlite3
src = sqlite3.connect(":memory:")
src.execute("CREATE VIRTUAL TABLE t USING fts4(x)")
src.execute("INSERT INTO t(x) VALUES ('hello world')")
script = "".join(src.iterdump())
dst = sqlite3.connect(":memory:")
dst.executescript(script)
# sqlite3.OperationalError: no such table: t
The SQLite shell's .dump does not emit content rows for virtual tables.
CPython versions tested on
3.14, 3.15, 3.16
Operating systems tested on
macOS
Linked PRs
Bug description
sqlite3.Connection.iterdump()emitsINSERTstatements for a virtual table'sown rows in addition to its schema. Those rows live in the shadow tables (which
are dumped separately), and on restore they run before the virtual table module
is instantiated, so restoring the dump fails:
The SQLite shell's
.dumpdoes not emit content rows for virtual tables.CPython versions tested on
3.14, 3.15, 3.16
Operating systems tested on
macOS
Linked PRs