删除最初用 'unknown tokenizer' 创建的 table?

Drop a table originally created with 'unknown tokenizer'?

我有一个sqlite3数据库。无法删除此数据库中的单个 table,错误消息显示 unknown tokenizer: mm

我直接在最新的 SQLiteSpy v1.9.11 and also within .NET code and the official sqlite NuGet 包 v 1.0.103.

中使用命令 DROP TABLE tablename; 进行了尝试

如何在分词器未知的地方删除 table?

documentation 说:

For each FTS virtual table in a database, three to five real (non-virtual) tables are created to store the underlying data. These real tables are called "shadow tables". The real tables are named "%_content", "%_segdir", "%_segments", "%_stat", and "%_docsize", where "%" is replaced by the name of the FTS virtual table.

所以要摆脱 table,删除阴影 tables:

DROP TABLE tablename_content;
DROP TABLE tablename_segdir;
DROP TABLE tablename_segments;
DROP TABLE tablename_stat;
DROP TABLE tablename_docsize;

然后使用(非常危险的)PRAGMA writable_schema 从系统中删除有关此 table 的剩余信息 table:

PRAGMA writable_schema = ON;
DELETE FROM sqlite_master WHERE type = 'table' AND name = 'tablename';

SQLite 缓存模式信息,因此您需要关闭并重新打开数据库。