DuckLake
Use a PostgreSQL database as the metadata catalog for your DuckLake table. Send2Bucket appends each delivery batch in a single DuckLake transaction.
What you provide
| Field | Kind | Example |
|---|---|---|
data_path | setting | s3://analytics-lake/ducklake/. Used when the lake is created; an existing lake keeps its own. |
metadata_schema | setting, optional | The Postgres schema holding DuckLake's metadata tables |
namespace | setting | The DuckLake schema for the table. Defaults to main. |
table | setting | events |
catalog | setting | Where the catalog lives: dsn, a Postgres you run and name with a DSN, or supabase, a project Send2Bucket sets up for you. Defaults to dsn. |
catalog_dsn | credential, dsn only | A libpq string: host=db.example.com dbname=lake user=s2bucket password=… |
catalog_project_ref | set for you, supabase only | The Supabase project holding the catalog. Send2Bucket fills it in, with metadata_schema, when it creates the catalog. |
storage | setting | Where the data path lives: s3 (Amazon S3), r2 (Cloudflare R2), supabase (Supabase Storage) or s3_compatible. Defaults to s3. |
account_id | setting, R2 only | Your Cloudflare account ID. The endpoint is https://<account_id>.r2.cloudflarestorage.com. |
project_ref | setting, Supabase Storage only | The project that holds the bucket. The endpoint is https://<project_ref>.storage.supabase.co/storage/v1/s3. |
access_key_id, secret_access_key | credential | An S3 key that can read and write under the data path. For Supabase Storage, create one under Storage → S3 in the project. |
region | setting, not for R2 | The data path's region, for example us-east-1. For Supabase Storage, the project's region. |
endpoint | setting, s3_compatible only | The storage's S3 endpoint, for example https://minio.example.com |
The catalog must be reachable from Send2Bucket over TLS. Create a dedicated database user for Send2Bucket, with rights only on the catalog database.
For an end-to-end walkthrough with events, OpenTelemetry and maintenance, see Stream events and OpenTelemetry into DuckLake.
Setup
Your own Postgres
-
Create the catalog database and the user:
CREATE USER s2bucket WITH PASSWORD '<password>';CREATE DATABASE lake OWNER s2bucket; -
Add the destination in the dashboard and select Verify. Send2Bucket attaches the catalog, creates the table in the namespace if it is missing, or checks an existing table's columns.
A Supabase project
Send2Bucket creates the catalog in a project of yours through Supabase's Management API.
- Add a destination of kind DuckLake · catalog and data in Supabase. On an existing DuckLake, set
catalogtosupabaseinstead. - Select connect Supabase and approve Send2Bucket for your Supabase organization. One connection serves the whole workspace.
- Choose the project and select create catalog. Send2Bucket creates a schema
s2b_lake_<id>, a writer role it keeps, and a read-only role whose password it shows once, in a DuckDB snippet. Whenstorageissupabasein the same project, it also creates the bucket named indata_path, or, with nodata_pathyet, a buckets2b-ducklakewith a folder for this lake. - Name the
table, paste an S3 access key from the project's Storage settings, save and select Verify.
Send2Bucket reaches the catalog through the project's connection pooler in session mode. Selecting rotate catalog credentials sets new passwords for both roles.
The destinations page shows who connected Supabase and when. An editor can disconnect it there: Send2Bucket revokes its access at Supabase and deletes its tokens. Catalogs it already created keep working, because each destination stores its own role passwords; creating or rotating a catalog needs connecting again.
Send2Bucket also maintains a lake whose catalog it created, nightly: it writes rows held in the catalog out to Parquet, merges small files, and expires snapshots older than 7 days, deleting the files only they used. Time travel therefore reaches back 7 days. A catalog you provide is yours to maintain.
The table has the columns in Delivery format. An existing table with other columns is left untouched, and setup fails with incompatible table: ….
Delivery and retries
A batch is delivered when the DuckLake transaction that appends its rows commits. If the commit response is lost, Send2Bucket looks for the batch's delivery_batch_id in the table before trying again, so a retry does not append the rows twice.
Reading the table
INSTALL ducklake;
ATTACH 'ducklake:postgres:dbname=lake host=db.example.internal user=analyst' AS lake
(DATA_PATH 's3://analytics-lake/ducklake/');
SELECT signal_type, count(*) FROM lake.main.events GROUP BY ALL;
Query your data
- DuckDB: attaches the lake read-only.
- PostgreSQL: through pg_duckdb.
- MySQL: load with DuckDB.
- Python: Polars, PyIceberg or the duckdb package.
- R: the duckdb package.
When Send2Bucket created the catalog in a Supabase project, the dashboard's query page and the MCP server's run_query also read the lake, as its read-only role. Their events view has the same columns as a bucket's.
To explore in a notebook or BI tool, see Integrations. The querying overview compares engines.