On 16 mai 2011, at 17:01, Tito Ciuro wrote:

> Hello,
> 
> I have a question about SQLite running on iOS. If I'm not mistaken, SQLite on 
> iOS is not compiled with R*Tree and FTS3. Compiling a static library of 
> SQLite's amalgamated version weighs at about 4.3 MB, which represents almost 
> 25% of the 20 MB-per-app allowed on the App Store. For many, this is a major 
> setback because many apps can easily reach this limit.
> 
> My question is: since a "light" version of SQLite is already included in iOS, 
> would it be too complicated to build a static library with only R*Tree and 
> FTS3 support? The idea being of course that the app would link against iOS' 
> SQLite and the app's R*Tree/FTS3 library, thus reducing the app's footprint 
> considerably.
> 
> Are there dependencies that would make this attempt a nightmare? Has anyone 
> gone through this?

I have considered this, but not done it as it turned out that I could do 
without R-Tree after all for the time being.

But my initial investigation suggested that it would be possible to do so. I 
simply went through the amalgamation source code where it registers the R-Tree 
extension, and I realize that I could simply do the same thing, but using the 
R-Tree source file from the canonic source code.

I didn't check for FTS3, but I suppose it's handled similarly.

I haven't done it, so I can't be sure there is not hidden trap, but I can think 
of at least one pitfall: version compatibility.

you must register with the iOS SQLite a R-Tree extension that is compatible 
with - if not exactly the same as - the iOS version of SQLite. It's unclear to 
me whether the *current* version of R-Tree is compatible with the *current* iOS 
SQLite version.

you could think that the best idea is to go back to the same R-Tree version as 
iOS's. But even that might be problematic, as iOS is a moving target, and you 
risk your app breaking on a future iOS version... if it is not rejected by 
Apple in the first place for registering an extension to the system SQLite (I 
don't know that as I haven't tried).

I am not knowledgeable enough with SQLite to understand what is the best way to 
minimize compatibility risks between different versions of the core Library and 
its standard extension.

But saving 4.3 MB of app size doesn't seem valuable enough to me to run those 
risks. Even if those 4.3 MB make you break the 20 MB threshold.

Sorry for not being more helpful.

Jean-Denis

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to