liveBook · Manning

Database extension

As explained in DuckDB in Action

A database extension is an installable software component that adds capabilities to a database system.

A database extension is an installable package that adds capabilities outside a database’s core. In DuckDB, extensions support workflows such as querying remote files, connecting to cloud databases, and extending query behavior. section 2.4 section 7.1.1

Manage an extension through a short lifecycle:

  • Inspect available, installed, and loaded extensions with duckdb_extensions(). section 2.4
  • Install a package with INSTALL name; installation stores it in the database but does not necessarily load it. section 2.4
  • Load it with LOAD name when needed; both commands are idempotent, and DuckDB can autoload installed extensions when it recognizes a required capability. section 2.4

Query a remote CSV with httpfs

DuckDB cannot query internet-hosted files by default. Install and load the official httpfs extension, then query the remote file directly: INSTALL httpfs; LOAD httpfs; SELECT count(*) FROM read_csv_auto('https://github.com/duckdb/duckdb/raw/main/data/csv/ips.csv.gz'); The extension enables HTTP(S), S3, and selected cloud-storage access without first downloading the file locally. section 2.4

The MotherDuck extension adds cloud database management, sharing, S3 access, and hybrid execution. Its MD_RUN parameter controls whether read functions execute locally, remotely, or automatically route remote URLs to the cloud; choosing the location can avoid unnecessary transfer and compute costs. section 7.3 section 7.3.5

Listing 2.4 The format of duckdb_extensions output
DESCRIBE
SELECT *
FROM duckdb_extensions();

Inspect the schema returned by duckdb_extensions() before selecting fields for extension inventory queries. section 2.4

How DuckDB in Action covers it

How deep it goes
Explains discovery, installation, loading, idempotence, autoloading, and execution placement, but does not detail extension development.
Examples
Demonstrates duckdb_extensions(), httpfs installation, remote CSV queries, MotherDuck management, and MD_RUN-controlled reads.
What you can do after
Operate/configure DuckDB extensions by inspecting availability, installing and loading packages, and selecting local or remote execution.
How it connects
Connects extensions to DuckDB SQL, HTTP(S), S3, MotherDuck, query execution, and hybrid local-remote processing.

Also explained in

Compare how 2 books explain database extension →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of DuckDB in Action. The section links point to the parts of the book it draws on.