Enviroment: Cocoa on mac os x Snow Leopard
I have reached the maximum (default) depth for a sqlite query:
Expression tree is too large (maximum depth 1000)
the sqlite documentation say to set the SQLITE_MAX_EXPR_DEPTH at compilation, but HOW? i use the default sqlite3 framework, imported with:
#import <sqlite3.h>
note: i think the maximum expression depth can be lowered (NOT increased) at run-time with:
sqlite3_limit(db,SQLITE_LIMIT_EXPR_DEPTH,size)
it’s right?
You’re right about all of your assertions (it’s a compile-time setting, it can be lowered not raised at runtime). Your options are to restrict your query or link a custom build of SQLite with your production app.
The good thing about SQLite is that it’s pretty simple to build. Read about custom builds. Also, Apple’s SQLite XCode project for OS X 10.6.8 is here. Whether you use Apple’s project or make your own, it’s easy to create a shared library to static link into your executable to ship with your project. You will have to worry about compatibility as you release your code, but that’s the price you pay for complex queries.
You could also ask about simplifying your complex query in another question.