Schema:
create table files (FILE_NAME TEXT, DATA TEXT);
create index idx_file_name on files (FILE_NAME);
create virtual table fts_files using fts2('file_name', 'data');
Ok, I just can't seem to figure out how to load fts2.dll in Python:
Standard sqlite3 module that comes with python does not even run a
query:
>>> row = conn.cursor().execute("select * from sqlite_master where type
= 'table'").fetchone()
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
OperationalError: malformed database schema - near "VIRTUAL": syntax
error
I tried apsw (Another python SQLite Wrapper), this one gets further, but
the error remains:
>>> conn2.cursor().execute("select file_name from fts_files where data
match 'BEGIN'")
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "apsw.c", line 4168, in Cursor_execute.sqlite3_prepare_v2
SQLError: SQLError: no such module: fts2
Sqlite3 and apsw has no function calls I can find to set the
enable_load_extention I tried just loading it in SQL:
>>> conn2.cursor().execute("SELECT load_extension('fts2')")
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "apsw.c", line 3518, in resetcursor
SQLError: SQLError: not authorized
Obviously this gives an error, the load_extention is off and I cant set
it on.
Apsw, claims in the documentation there is a function called
enableloadextention, but for the life of me I cant find it.
I'm having the same problem with .net, cant find a function which does
this...
Just wondering if anyone has done this in python and C# .NET that can be
of assistance
Thanks.