Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using SQLite's FTS3/4 with Python 3

Tags:

python

sqlite

I have been working on peewee's example blog application using python's Flask framework. (See https://github.com/coleifer/peewee, inside examples>blog).

I have installed all the requirements but when I try to run the application I keep getting

no such module : FTS4

error.

Why do you think I get this error? Does this mean the standard Python3 sqlite3 module doesn't have FTS modules?

If so is there a way to enable (install) FTS3/FTS4 modules for Python 3.4?

like image 409
Mehmet Ragıp Altuncu Avatar asked Oct 15 '25 15:10

Mehmet Ragıp Altuncu


1 Answers

You can open a sqlite shell and run pragma compile_options to see what your SQLite has. AFAIK this has nothing to do with Python3.

Here are mine:

sqlite> pragma compile_options;
ENABLE_COLUMN_METADATA
ENABLE_FTS3
ENABLE_RTREE
ENABLE_UNLOCK_NOTIFY
SECURE_DELETE
SYSTEM_MALLOC
THREADSAFE=1

You may need to recompile SQLite if you find you do not have the FTS extension. Also check out the docs:

http://sqlite.org/fts3.html

like image 174
coleifer Avatar answered Oct 17 '25 06:10

coleifer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!