FTS3?

672 views
Skip to first unread message

John Nowak

unread,
Aug 24, 2009, 4:24:34 PM8/24/09
to SQLCipher Users
Can anyone confirm that sqlcipher supports FTS3? Building with
DSQLITE_ENABLE_FTS3=1 seems to yield an archive without support.

Stephen Lombardo

unread,
Aug 24, 2009, 4:51:19 PM8/24/09
to sqlc...@googlegroups.com
Hi John,

Yes, FTS3 does work with SQLCipher. If you are compiling from the command line try:

./configure CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3 -lcrypto"
make

When you fire up the ./sqlite3 you can run something like this to test:

sqlite> pragma key = 'test123';
sqlite> create table t1(a integer, b text);
sqlite> insert into t1(a,b) values (1, "this is test message number one");
sqlite> insert into t1(a,b) values (2, "this is test message number two");
sqlite> create virtual table t1_fts using fts3(a integer, b text);
sqlite> insert into t1_fts select * from t1;
sqlite> select * from t1 inner join t1_fts on t1.a = t1_fts.a where t1_fts.b match 'one';
1|this is test message number one|1|this is test message number one

sqlite> select * from t1 inner join t1_fts on t1.a = t1_fts.a where t1_fts.b match 'two';
2|this is test message number two|2|this is test message number two

sqlite> select * from t1 inner join t1_fts on t1.a = t1_fts.a where t1_fts.b match 'message';
1|this is test message number one|1|this is test message number one
2|this is test message number two|2|this is test message number two

If you are using SQLCipher on the iphone or with the XCode project you will need to adjust the Targets -> amalgamation -> Run Script -> Info -> General Script contents to include the proper define on the ./configure command line. You'll also need to add the define to the "Other C Flags" setting under Targets -> sqlcipher -> Info -> Build.

Cheers,
Stephen

jo...@johnnowak.com

unread,
Aug 24, 2009, 5:13:33 PM8/24/09
to sqlc...@googlegroups.com
On Mon, 24 Aug 2009 16:51:19 -0400, Stephen Lombardo
<sjlom...@zetetic.net> wrote:
> Hi John,
>
> Yes, FTS3 does work with SQLCipher. If you are compiling from the command
> line try:
>
> ...

Fantastic Stephen. Thanks for the assistance.

Reply all
Reply to author
Forward
0 new messages