Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails with wagtail and sqlite3 #38

Closed
iurisilvio opened this issue Jun 1, 2023 · 3 comments · Fixed by #39
Closed

Fails with wagtail and sqlite3 #38

iurisilvio opened this issue Jun 1, 2023 · 3 comments · Fixed by #39

Comments

@iurisilvio
Copy link
Collaborator

Looks like the generated sqlite3 dump is broken.

The failure is related with a virtual table and it looks like iterdump miss this implementation.
https://github.com/python/cpython/blob/main/Lib/sqlite3/dump.py#L45

@iurisilvio
Copy link
Collaborator Author

I tried to fix the iterdump output.

  1. It must have a first PRAGMA foreign_keys=OFF; statement before start transaction.
  2. Instead of a CREATE VIRTUAL TABLE, it must enable writable schema and write direct to sqlite_schema table. It must be changed in Python implementation.
PRAGMA writable_schema=ON;
INSERT INTO sqlite_schema(type,name,tbl_name,rootpage,sql)VALUES('table','wagtailsearch_indexentry_fts','wagtailsearch_indexentry_fts',0,'CREATE VIRTUAL TABLE wagtailsearch_indexentry_fts USING fts5(autocomplete, body, title)');

@iurisilvio
Copy link
Collaborator Author

For now, I'll just change implementation to use sqlite3 binary .dump command.

@iurisilvio
Copy link
Collaborator Author

It is a known issue. python/cpython#64662

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant