The callback approach in sqlite3_exec is really complicating my code. I used it initially for select: and then re-used for count: with where clause. The problem is that you have to pass the context to the C function and back and you need flexibility in handling the result set. I will cleanup the code and move to the more verbose sqlite3_prepare_v2 and friends.
With the modification above I will be able to add a small cache of compiled statements, will have to run some memory/performance numbers on it to tune it for my usage.
Advertisement