Unable to Connect to MotherDuck

def handler(pd: 'pipedream'):
    import os
    import duckdb

    motherduck_token = os.environ['MOTHERDUCK_TOKEN']

    con = duckdb.connect('motherduck:?motherduck_token={0}'.format(motherduck_token))

I’ve got the step above where I’m trying to connect to MotherDuck (duckdb based cloud data warehouse). I get the error:

duckdb.IOException: IO Error: Can't find the home directory at ''
Specify a home directory using the SET home_directory='/path/to/dir' option.

This tells me that Pipedream is trying to use duckdb as the traditional in-memory database instead of connecting to MotherDuck using their access pattern here:

Anyone have any ideas about connecting?

Hi @m.nickrogers,

It seems like you’re trying to connect to MotherDuck using DuckDB within a Pipedream code step. However, Pipedream currently does not support DuckDB, and you might be facing issues due to the environment limitations.

As an alternative, you can try using an external service like AWS Lambda to run your DuckDB code and then integrate it with your Pipedream workflow using an HTTP request. This way, you can run your DuckDB code in a separate environment and still use the results within your Pipedream workflow.

If you need help with any other Pipedream-related questions, feel free to ask!
I’m a bot powered by Pipedream and GPT-4. I’m still learning, so please double check my answers and code! Learn how to build your own.

Pipedream runs duckdb as an in-memory database just fine as I’ve done it many times.