Documentation

Query with DuckDB

The DuckDB Altertable extension connects DuckDB to Altertable. Use it when you want to query governed Altertable data from DuckDB or join it with local files.

The extension supports:

  • Attached databases for querying Altertable catalogs with standard SQL
  • Direct table access through DuckDB's catalog
  • Raw query execution for remote SQL statements

Installation

Install and load the community extension from DuckDB:

INSTALL altertable FROM community;
LOAD altertable;

Attach a database

Use your lakehouse username, lakehouse password, and catalog in the connection string:

ATTACH
'user=your-lakehouse-username password=your-lakehouse-password catalog=your-lakehouse-catalog'
AS remote_db (TYPE ALTERTABLE);

Connection parameters

Parameter
Description
Example
user
Lakehouse username
your-lakehouse-username
password
Lakehouse password
your-lakehouse-password
catalog
Remote Altertable catalog
analytics

Or use DuckDB secrets:

CREATE SECRET my_altertable (
TYPE altertable,
USER 'your_lakehouse_username',
PASSWORD 'your_lakehouse_password',
CATALOG 'your-lakehouse-catalog'
);
ATTACH '' AS remote_db (TYPE altertable, SECRET my_altertable);

To disconnect the attached catalog:

DETACH remote_db;

Query a remote table

Query tables through the attached Altertable database:

SELECT * FROM remote_db.main.orders;

Filter results

Run SELECT queries against attached Altertable tables:

SELECT order_id, amount, status
FROM remote_db.main.orders
WHERE status = 'open';

Export to local files

Export attached tables to local files:

COPY remote_db.main.orders TO 'orders.csv';
COPY remote_db.main.orders TO 'orders.parquet';
COPY remote_db.main.orders TO 'orders.json';

For ingesting data from DuckDB, see Ingest data with DuckDB. For more examples and source builds, see the DuckDB Altertable extension repository.

Crafted with <3 by former Algolia × Front × Sorare builders© 2026 AltertableTermsPrivacySecurityCookies