Disliking more and more sqlite3_exec with callback

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.