gpt4 book ai didi

sqlite - 删除最初使用 'unknown tokenizer' 创建的表?

转载 作者:行者123 更新时间:2023-12-03 18:45:04 24 4
gpt4 key购买 nike

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

我直接用命令DROP TABLE tablename;试了一下里面最新的SQLiteSpy v1.9.11 以及 .NET 代码和官方 sqlite NuGet包 v 1.0.103。

如何删除标记器未知的表?

最佳答案

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.



所以要摆脱那个表,删除影子表:
DROP TABLE tablename_content;
DROP TABLE tablename_segdir;
DROP TABLE tablename_segments;
DROP TABLE tablename_stat;
DROP TABLE tablename_docsize;

然后使用(非常危险的) PRAGMA writable_schema从系统表中删除有关此表的剩余信息:
PRAGMA writable_schema = ON;
DELETE FROM sqlite_master WHERE type = 'table' AND name = 'tablename';

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

关于sqlite - 删除最初使用 'unknown tokenizer' 创建的表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40877078/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com