C API
See the following link for the full documentation of the C library API.
Linking
Using the pre-built library
See Installation and Get Started for simple manual instructions for building with the C library.
Alternatively, here is an example configuration for integrating the pre-built library into a CMake project (substitute URL
and URL_HASH
and libkuzu.so
as appropriate for your platform).
Linking against Kùzu when built from source
See the requirements in https://docs.kuzudb.com/developer-guide/. It’s recommended that you use CMake if you want to link to the kuzu static library as shown in the example below.
CMake
The following example uses FetchContent to download and build kuzu as a dependency within a CMake project, and links it either statically or dynamically to an example executable (which can be configured with the EXAMPLE_SHARED
option). See Get Started for an example of main.c
.
Other Build Systems
Using other build systems with the dynamic library is still relatively simple as all you need to make use of is the dynamic library and kuzu.h, both of which can be installed by CMake. E.g. your build system can run.
And then link against <install-dest>/libkuzu.so
(or libkuzu.dylib
/libkuzu.lib
depending on your platform) and add <install-dest>
to your include directories.
The static library is more complicated (as noted above, it’s recommended that you use CMake to handle the details) and is not installed by default, but all static libraries will be available in the build directory.
You need to define KUZU_STATIC_DEFINE
, and link against the static kuzu library in build/src
, as well as antlr4_cypher
, antlr4_runtime
, brotlidec
, brotlicommon
, utf8proc
, re2
, serd
, fastpfor
, miniparquet
, zstd
, miniz
, mbedtls
, lz4
(all of which can be found in the third_party subdirectory of the CMake build directory. E.g. build/third_party/zstd/libzstd.a
) and whichever standard library you’re using.