views:

149

answers:

1

What is the SQLite query to detect if the FTS3 extension module is installed? Or is it possible to get a list of installed extensions with an SQLite3 query? It has to work with pysqlite2.

I know that I can get the list of tables using SELECT * FROM sqlite_master, I'd like to get something similar for the list of extensions. I also know that CREATE VIRTUAL TABLE v USING FTS3 (t TEXT) succeeds iff FTS3 is installed, but I'd like to get a query without side effects (not even creating a temporary table).

As a workaround I have opened the ":memory:" database, and issued the CREATE VIRTUAL TABLE command above.

+3  A: 

There is no way to do it in SQLite at the moment; it forgets what it has loaded and cannot report it even if it wanted to (I checked the source to the code that does the loading, and the critical information that describes what is loaded is just not stored). It is known (see Wish List at the bottom of that page) that it would be good to retain this information, but it does not appear to be retained as yet.

As a consequence, the only thing you can do is your current workaround – trying it and seeing if it works. Sorry I can't offer anything else.

Donal Fellows