Hi list:

Using SQLite 3.9.1, suppose a C++ application using FTS3/4 modules with this 
pseudocode:

1a In config.h

    #define SQLITE_ENABLE_FTS3 1
    #define SQLITE_ENABLE_FTS3_PARENTHESIS 1

2a.- Delete the previous table if exist

    DROP TABLE IF EXISTS ftsm

3a.- Then create the table

    CREATE VIRTUAL TABLE ftsm USING fts4(nm,tokenize=simple,matchinfo=fts3)

4a.- Populate the table

    INSERT INTO ftsm (rowid,nm) SELECT id,nm FROM atm WHERE(...)

The app run as espected and the search mechanism work as a charm.

Then try to upgrade the app to use the FTS5 module -within the previous dbases- 
with this pseudocode:

1b In config.h

    #define SQLITE_ENABLE_FTS5 1

2b.- Delete the previous table if exist (same as previous)

    DROP TABLE IF EXISTS ftsm

3b.- Then create the table

    CREATE VIRTUAL TABLE ftsm USING fts5(nm,tokenize='unicode61 
remove_diacritics 0',columnsize=0)

4b.- Populate the table (same as previous)

    INSERT INTO ftsm (rowid,nm) SELECT id,nm FROM atm WHERE(...)

When reaching 2b, the new app show an error: "no such module: fts4"

When accessing the dataBase with the shell, the .tables command show the ftsm 
table. Then, using manually the 2a query ("DROP TABLE IF EXISTS ftsm;") the 
table is deleted without complain and the .tables command show that the table 
not longer exist.

Then, the app step thru 2b without complain and creates and populates the new 
table smoothly (steps 3b and 4b).

The question: do is there any method to delete the old table without including 
the FTS3/4 modules to those users "in the field"?

Thanks for any idea.

--
Adolfo J. Millan


Reply via email to