Skip to content

Fails with wagtail and sqlite3 #38

Closed

Description

@iurisilvio

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

Activity

  1. iurisilvio commented on Jun 1, 2023

    @iurisilvio
    CollaboratorAuthor

    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)');
    
  2. iurisilvio commented on Jun 1, 2023

    @iurisilvio
    CollaboratorAuthor

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

  3. iurisilvio commented on Jun 1, 2023

    @iurisilvio
    CollaboratorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions