SQLCipher/ Swift 4/ Error when trying to use FTS5 query

I am trying to run this query:

**let** peopleIndexQuery = "SELECT * FROM peopleIndex WHERE peopleIndex Match '\(searchTerm)*' ORDER BY rank"

but I am getting this error:

no such module: FTS5

and I was unable to find instructions on how to install SQLCipher to enable FTS5 support

I installed SQLCipher into my iOS projecting following the steps listed here

I installed SQLCipher into my iOS projecting following the steps listed here

Hello @amberDevelops - how are you bringing SQLCipher into your application as a dependency?

I cloned the project, ran the make compile.c command, imported the files into a swift Xcode project

I successfully unlocked the db as well as queried but I’m unable to use fts5 “MATCH” keyword to query

Hello @amberDevelops - thanks for clarifying that. Since you are compiling the amalgamation into the application, you would need to enable the Compile-time Options corresponding to the features you want to enable. In this case, you’d need to add -DSQLITE_ENABLE_FTS5 to the C flags to enable FTS5.

1 Like

Thank you, when you say add " -DSQLITE_ENABLE_FTS5" to the C flags, does that mean I need to pass that as an argument when I run

$ ./configure --with-crypto-lib=none

@amberDevelops - It depends on when you are compiling the code. When you say ou “imported the files into a swift Xcode project”, what files are you referring to? If you are importing SQLCipher’s *.c and *.h files, then you will need to add the C flags in Xcode. Otherwise, if you are compiling using make to generate .dylib or .a files, then you would need to add the C flags to the configure command.

1 Like

Thank you for all of your help! I was able to add the “-DSQLITE_ENABLE_FTS5” line within Xcode under
build settings > other C Flags

Great, I’m glad to hear that worked for you!

1 Like