开发者

Xcode SQLite Extension for use on iPhone

I am looking to use a SQLite extension in my application, with the exception of SpatiaLite I cannot find any other examples of where extensions are being used. The following post had some suggestions but nothing that made me any wiser: How to link a SQlite Extension Source File into Xcode for iPhone?

The extension that I am trying to load is: https://github.com/mateusza/SQLite-Levenshtein/blob/master/src/levensht开发者_如何学Cein.c

I have compiled the above extension but of course I cannot include this in my application for usage like:

SELECT load_extension('extension.sqlext');

Can somebody tell me how to either:

1) Compile sqlite to include my extension.

2) Use sqlite_auto_extension to include my extension.

Edit: I have sqlite amalgamation and the above source files now included in my project, I just need an example of how to use sqlite_auto_extension for use with the above extension, and where to call this.


Actually, it seems you cannot use dynamic libraries for iOS project. However, in your particular case you can get sources of that module, add them to project (there is one file only), and change some code in: int sqlite3_extension_init() to call only sqlite3_create_function(db, "levenshtein", 2, SQLITE_ANY, 0, levenFunc, 0, 0); And do that call after opening your database.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜