I recently ended up building a configuration system for a piece of C++ software I’m maintaining. One feature I wanted was: I want to just create new configuration items at arbitrary locations in my code without “registering” them somewhere centrally. The config system should just “pick them up” on startup.
One prominent example of a library using a similar functionality is Google Test, Google’s testing framework. In Google Test, you can just write something like
1TEST(TestSuiteName, TestName) {
2 ... test body ...
3}
somewhere is your code, and when Google Test’s main function runs, it picks up on your test and runs it.
How does one achieve that?
I currently build a piece of software which will need a lot of bog-standard SQL queries against an in-memory database. I was (and am) going with SQLite, but a good friend of mine who Knows About Databases™ told me recently that currently, DuckDB is the hot stuff among in-memory databases - but mainly for complex (read: OLAP) queries.
In this article I explore whether DuckDB or SQLite is the better (read: faster) alternative for my simple queries.