SQLite3 fts3 AUTOINCREMENT not working

I am trying to create a virtual table in sqlite3 using fts3 and have the column as auto-increment, but when inserting values, the column is not populated. Code:

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

Insert: insert into the contact (name) values ​​('abc') the field 'id' does not increase and the data in the table looks only

abc

Auto-increment is not supported in fts3 sqlite3?

Yours faithfully,
John

+4
source share
2 answers

I found the answer to this question in another question here

The short answer is to use the "rowid" column (special column) for the fts3 table identifier. Not sure if you can reference the rowid column as I have not tried this.

Hope this solves your problem. :)

+3
source

When creating an FTS virtual table, it ignores everything except column names (for example, auto-increment, primary key, unique, and even integer). Everything in the FTS table is just text. It reads these keywords without errors, but they are just β€œsweet syntax” for documentation.

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

+1
source

Source: https://habr.com/ru/post/1347718/


All Articles