Preview of a new ADBC driver for MotherDuck¶
An alpha release of a new ADBC driver for MotherDuck is available through dbc . Install version 0.1.0-alpha.1 with:
$ dbc install --pre motherduck
The driver supports SQL query execution, bind parameters, table schema discovery, prepared statements, and transactions. See the ADBC Driver for MotherDuck documentation. This is a preview release, and more features are actively being developed, so stay tuned. SSO login, bulk ingestion, and COPY result reads are not supported in this release but are on the roadmap.
The driver was developed by the ADBC Driver Foundry with support from MotherDuck. It is implemented in C++, and is based on Apache Arrow ADBC’s libpq-based PostgreSQL driver. Connections are made through MotherDuck’s Postgres endpoint allowing users to run queries without needing a local duckdb client.
To get started, set the MOTHERDUCK_TOKEN environment variable to your MotherDuck token and provide a connection URI with a motherduck:// scheme:
motherduck:///my_db
Set motherduck.region to your account’s region, which you can find with md_user_info().
The driver can then be used like any other driver. For example, load it in Python with adbc-driver-manager, replacing the database name and region with your own:
from adbc_driver_manager import dbapi
with (
dbapi.connect(
driver="motherduck",
db_kwargs={
"uri": "motherduck:///my_db",
"motherduck.region": "us-east-1",
},
) as con,
con.cursor() as cursor,
):
cursor.execute("SELECT 42")
table = cursor.fetch_arrow_table()
Bug reports and feature requests are welcome through GitHub Issues in the motherduck repository in the ADBC Driver Foundry. You can also start a Discussion on GitHub or join the Columnar Community Slack .