Introducing Flights: agent-native data pipelines in MotherDuckJoin the livestream

Skip to main content

Google Colab

Google Colab notebooks can query MotherDuck by installing DuckDB and opening an md: connection from Python.

How it works with MotherDuck

  1. Install DuckDB in the Colab notebook.
  2. Store your MotherDuck token in Colab secrets or another notebook-safe secret store.
  3. Connect with duckdb.connect("md:...") and run SQL from notebook cells.

Example

%pip install duckdb

import duckdb

con = duckdb.connect('md:my_db')
con.sql('SELECT current_database()').show()