dimanche 24 avril 2016

How do you add a SQLite3 created function to an iOS 7 project?

I am trying to build a simple SQLite full text search (FTS4) for an iOS 9/Xcode 7 project w/ Swift 2.2. I am accessing the SQLite3 C API directly with Swift, I see no need to use a bloated wrapper library. I have the full text search working perfectly. Now I need to create a ranking function for the results. I already have the C code for the ranking function, the problem is I have no idea how to:

  1. Get the C source or compiled executable of the ranking function code into the compiled iOS project.
  2. Create or Load the ranking function within SQLite (sqlite3_create_function)
  3. Have SQLite recognize the created function

So basically, I have the C source code of the ranking function and have failed at every attempt to get SQLite to recognize the function.

Thanks for you help.

Aucun commentaire:

Enregistrer un commentaire