Menu
On this page

Database & cloud sources

Connect to MotherDuck

Import any query result from a MotherDuck database as a dataset.

Before you start

You need a MotherDuck service token (create one in MotherDuck under Settings → Access tokens). The connection field accepts the token in any of these shapes:

motherduck_token=<your-token>

— or an md: connection string, or just the bare token pasted on its own.

Connect

  1. From your project, select Create Dataset, then the MotherDuck tile under Connect to Database.
  2. Name the dataset and paste your token.
  3. Write the SQL query whose result becomes the dataset — qualify tables with the database name, for example SELECT * FROM my_db.main.orders.
  4. Optionally set a Timestamp column and an AI context hint, then select Import dataset.

Enable incremental refresh

Set Timestamp column to a growing column in your result. Incremental refreshes append only rows newer than the last run; full refresh remains available either way. See Refresh & scheduled refreshes.

Note

The import executes on MotherDuck and transfers the result cloud-to-cloud through a temporary export. Because of how that export works, your query can't itself contain COPY … TO statements — plain SELECT queries are the supported shape.