Sardor Dushamov
Sardor Dushamov

Reputation: 1667

How to create virtual table for FTS3 with ORMLite

I couldn't find a way to use FTS3 with ormlite because, I have problems creating a virtual table. I need to run something like this in native sqlite:

CREATE VIRTUAL TABLE enrondata1 USING fts3(content TEXT);

But ORMLite calls the below method for creating a simple table

TableUtils.createTable(ConnectionSource connectionSource, Class<T> dataClass);

In this answer for the question: FTS3 searches in ORMLite?, written about using ORMLite's raw query interface, unfortunately, I could not find a way to create a table with it.

How can I use FTS3 with ormlite?

Upvotes: 1

Views: 924

Answers (1)

CL.
CL.

Reputation: 180270

The queryRaw function is only for SELECT queries. To execute other commands, use raw execute statements.

For example:

dao.executeRaw("CREATE VIRTUAL TABLE enrondata1 USING fts3(content TEXT);");

Upvotes: 3

Related Questions