4

我正在尝试使用 fts3 在 sqlite3 中创建一个虚拟表,并将列作为自动增量,但是在插入值时,该列没有被填充。代码:

CREATE VIRTUAL TABLE contact
USING fts4(
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    name TEXT);

当插入:插入联系人(姓名)值('abc')时,'id'字段没有增加,表中的数据看起来只是
|abc

sqlite3 的 fts3 不支持自动增量吗?

问候,
约翰

4

2 回答 2

4

我在这里的另一个问题中找到了这个问题的答案

简短的回答是使用列“rowid”(特殊列)作为 fts3 表的 id。不确定您是否可以引用 rowid 列,因为我没有尝试过。

希望这能解决您的问题。:)

于 2011-11-15T08:54:18.760 回答
1

When creating an FTS 'Virtual Table' it ignores everything but the column names (e.g. auto increment, primary key, unique, and even Integer). Everything to an FTS table is just text. It reads those keywords in without error, but they are just 'sugary syntax' per the documentation.

http://www.sqlite.org/fts3.html

于 2013-06-21T16:53:15.773 回答