Search Shortcut cmd + k | ctrl + k
Search cmd+k ctrl+k
1.0 (stable)
Building Extensions

Extensions can be built from source and installed from the resulting local binary.

Building Extensions using Build Flags

To build using extension flags, set the corresponding BUILD_[EXTENSION_NAME] extension flag when running the build, then use the INSTALL command.

For example, to install the httpfs extension, run the following script:

GEN=ninja BUILD_HTTPFS=1 make

For release builds:

build/release/duckdb -c "INSTALL 'build/release/extension/httpfs/httpfs.duckdb_extension';"

For debug builds:

build/debug/duckdb -c "INSTALL 'build/debug/extension/httpfs/httpfs.duckdb_extension';"

Extension Flags

For every in-tree extension that is maintained by core DuckDB there exists a flag to enable building and statically linking the extension into the build.


When this flag is set, the autocomplete extension is built.


When this flag is set, the icu extension is built.


When this flag is set, the tpch extension is built, this enables TPCH-H data generation and query support using dbgen.


When this flag is set, the tpcds extension is built, this enables TPC-DS data generation and query support using dsdgen.


When this flag is set, the TPCE extension is built. Unlike TPC-H and TPC-DS this does not enable data generation and query support. Instead, it enables tests for TPC-E through our test suite.


When this flag is set, the fts (full text search) extension is built.


When this flag is set, the httpfs extension is built.


When this flag is set, the jemalloc extension is built.


When this flag is set, the json extension is built.


When this flag is set, the inet extension is built.


When this flag is set, the SQLSmith extension is built.

Debug Flags


D_ASSERT(condition) is used all throughout the code, these will throw an InternalException in debug builds. With this flag enabled, when the assertion triggers it will instead directly cause a crash.


In our execution format string_t has the feature to "inline" strings that are under a certain length (12 bytes), this means they don't require a separate allocation. When this flag is set, we disable this and don't inline small strings.


Our data structures that are used extensively throughout the non-performance-critical code have extra checks to ensure memory safety, these checks include:

  • Making sure nullptr is never dereferenced.
  • Making sure index out of bounds accesses don't trigger a crash.

With this flag enabled we remove these checks, this is mostly done to check that the performance hit of these checks is negligible.


When previously pinned blocks in the BufferManager are unpinned, with this flag enabled we destroy them instantly to make sure that there aren't situations where this memory is still being used, despite not being pinned.


When a crash or assertion hit occurs in a test, print a stack trace. This is useful when debugging a crash that is hard to pinpoint with a debugger attached.

Using a CMake Configuration File

To build using a CMake configuration file, create an extension configuration file named extension_config.cmake with e.g., the following content:


Build DuckDB as follows:

GEN=ninja EXTENSION_CONFIGS="extension_config.cmake" make

Then, to install the extensions in one go, run:

# for release builds
cd build/release/extension/
# for debug builds
cd build/debug/extension/
# install extensions
for EXTENSION in *; do
    ../duckdb -c "INSTALL '${EXTENSION}/${EXTENSION}.duckdb_extension';"
About this page

Last modified: 2024-07-20