Hi everyone,
Context: DuckDB is a very popular in-process analytical database. People can develop extensions for it to add missing functionalities. DuckDB provides two sets of APIs for developing extensions: the C API, which is relatively stable but may have a limited feature set, and the C++ API. While the C++ API is more high-level, it can change with every new release of DuckDB, which in turn can make building, updating, and maintaining extensions harder.
Anyhow, I made an opinionated project template that lets people develop and build DuckDB extensions in Zig using the C API. I think this is an excellent showcase of Zig’s power because the extension can be compiled for different OSes and hardware architectures in seconds, without the need for separate or complicated build pipelines, thanks to Zig’s cross-compilation capabilities.
In case you’re interested, the GitHub link of the project: https://github.com/habedi/template-duckdb-extension-zig