DuckDB has a flexible extension mechanism that allows for dynamically loading extensions. These may extend DuckDB’s functionality by providing support for additional file formats, introducing new types, and domain-specific functionality.
Extensions are loadable on all clients (e.g., Python and R). Extensions distributed via the official repository are built and tested on MacOS (AMD64 and ARM64), Windows (AMD64) and Linux (AMD64 and ARM64).
We maintain a list of official extensions.
To get a list of extensions, run:
|arrow||false||false||A zero-copy data integration between Apache Arrow and DuckDB|||
|autocomplete||false||false||Adds support for autocomplete in the shell|||
DuckDB has three types of extensions.
Built-in extensions are loaded at startup and are immediately available for use.
SELECT * FROM 'test.json';
This will use the
json extension to read the JSON file.
Autoloadable extensions are loaded on first use.
SELECT * FROM 'https://raw.githubusercontent.com/duckdb/duckdb-web/main/data/weather.csv';
To access files via the HTTPS protocol, DuckDB will automatically load the
Similarly, other autoloadable extensions (
fts) will be loaded on-demand.
If an extension is not already available locally, it will be installed from the official extension repository (
Some extensions make several changes to the running DuckDB instance, hence, autoloading them may not be possible. These extensions have to be installed and loaded using the following SQL statements:
INSTALL spatial; LOAD spatial;
If you are using the Python API client, you can install and load them with the
install_extension(name: str) and
load_extension(name: str) methods.
Autoloadable extensions can also be installed explicitly.
Extensions are signed with a cryptographic key, which also simplifies distribution (this is why they are served over HTTP and not HTTPS). By default, DuckDB uses its built-in public keys to verify the integrity of extension before loading them. All extensions provided by the DuckDB core team are signed.
If you wish to load your own extensions or extensions from third-parties you will need to enable the
To load unsigned extensions using the CLI client, pass the
-unsigned flag to it on startup.
For the Python client, see the Loading and Installing Extensions section in the Python API documentation.
The shared installation location allows extensions to be shared between the client APIs of the same DuckDB version, as long as they share the same
platfrom or ABI. For example, if an extension is installed with version 0.9.2 of the CLI client on MacOS, it is available from the Python, R, etc. client libraries provided that they have access to the user’s home directory and use DuckDB version 0.9.2.
See the Working with Extensions page for details on available platforms.
Extensions are by default installed under the user’s home directory:
For example, the extensions for DuckDB version 0.9.2 on macOS ARM64 (Apple Silicon) are installed to
For development builds, the directory of the extensions corresponds to the Git hash of the build, e.g.,
To specify a different extension directory, use the
extension_directory configuration option:
The same API that the official extensions use is available for developing extensions. This allows users to extend the functionality of DuckDB such that it suits their domain the best.
A template for creating extensions is available in the
For advanced installation instructions and more details on extensions, see the Working with Extensions page.