⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
Share a DuckDB Database That Only Stores Views

A DuckDB database file does not have to contain any data: it can store only view definitions that point at remote data such as Parquet files on object storage. The resulting file is only a few hundred kilobytes, yet it behaves like a shared catalog: anyone who attaches it sees a set of named, ready-to-query relations, while the underlying data stays in its original location and format.

This is useful for publishing a curated “semantic layer” over a data lake, where the view definitions encode the joins, filters, and column names that consumers should use, without copying or moving the data itself.

Prerequisites

This guide requires the httpfs extension, which can be installed using the INSTALL httpfs SQL command. This only needs to be run once.

Building the Catalog

Create a persistent database file and define views that reference the remote data. Use fully qualified locations (remote URLs or absolute paths) so that the views resolve regardless of the client's working directory:

ATTACH 'catalog.duckdb' AS catalog;
USE catalog;

CREATE VIEW services AS
    SELECT *
    FROM read_parquet('s3://my-bucket/rail/services/*.parquet');

CREATE VIEW stations AS
    SELECT *
    FROM read_parquet('s3://my-bucket/rail/stations.parquet');

Because the file stores only view definitions, it stays small no matter how large the referenced datasets are.

Hosting the Catalog

Upload the catalog.duckdb file to any location that DuckDB can read over the network, for example an s3:// bucket or an https:// endpoint.

Querying the Catalog

Consumers attach the catalog read-only and query the views as if they were local tables. Each query reads the current data from the referenced remote files:

ATTACH 'https://example.com/catalog.duckdb' AS catalog (READ_ONLY);

SELECT count(*) AS num_stations
FROM catalog.stations;

Consumers need the httpfs extension and, for s3:// sources, credentials that grant access to the underlying data.

Limitations

© 2026 DuckDB Foundation, Amsterdam NL
DuckDB Home Code of Conduct Trademark Use Blog