SQLite Inspect – Find misuse of SQLite – Alpha

SQLite is a great project but even with the nicest library you can make mistakes. I created a single-header inspection wrapper, to quickly and easily detect the most common issues in code using SQLite.

And since I know from experience that it would be a pain to instrumentize your code to do this, I decided to make this work with just a single #include.

So all you have to do is download and extract sqlite_inspect_amalgamation.h and store it in the same folder where sqlite3.h lives.

Then open sqlite3.h and append the following line:

#include "sqlite_inspect_amalgamation.h"

There. All done. Just compile and run.

What SQLite-Inspect checks for

This is the list of currently supported checks.

Missing finalize calls for statements

The check will not only tell you that a statement wasn’t closed but also which statements they were.

Invalid/double finalize calls

In case sqlite3_finalize is called a second time on a statement or with some garbage pointer, SQLite-Inspect will tell you that.

Failure to close DB

Usually the reason for this is at least one unclosed statement. SQLite-Inspect will tell you that the database could not be closed along with the given error code and in case of open statements also a list of statements that prevented closing.

Statistics overview

SQLite-Inspect will also give you a list of statements executed and the number of times they were prepared, which should give you a good hint about using statement-caches.

SQLite-Inspect result file

By default SQLite-Inspect will automatically write a report named sqlite-inspect-report.txt into the working directory of the instrumented binary.

Current state of the project

This is in a pre-alpha stage, meaning that you might encounter bugs, non-existing documentation or code comments and overall chaoticness.

But hey, it’s plug and play. So there’s a good chance that it might already work fine for you.

Feedback appreciated

So if you find this interesting, give it a spin and please let me know your thoughts at inspect(funny a)thisdomain.



Nice way to stop/reduce trackers

There’s some discussion about the morality of using ad-blockers. Matter of fact, it’s not so much the mindbendingly annoying or downright scammy ads that annoy me the most. It’s the ruthless tracking that’s my problem. Strange enough, I’m still using Google Analytics for this site. Quite the double standard. I guess I’ll have to do something about this…

But back to the topic at hand. Here’s a a nice collection of sites to block. All wrapped up nice and tidy to be added to your hosts file.

It will also block Google Analytics and therefore the GA site itself, so keep that in mind if you’re trying to take a look at your sites stats. ;)



The other day I was looking for a way to get easy coverage analysis for a C++ project. On Linux there’s gcov but on Windows there didn’t seem to be something like this. After some searching I came across OpenCppCoverage which looks quite good. Especially as it doesn’t require instrumentation.



I came across a really nice article about pathfinding by Amit Patel. The great thing is that every example there is interactive so you can freely move start and end points or add, remove and modify obstacles.

It’s fun to play around with. Also take a look at his other articles.