Skip to content

DuckDB

Install

Install ibis and dependencies for the DuckDB backend:

pip install 'ibis-framework[duckdb]'
conda install -c conda-forge ibis-duckdb
mamba install -c conda-forge ibis-duckdb

Connect

API

Create a client by passing in a path to a DuckDB database to ibis.duckdb.connect.

See ibis.backends.duckdb.Backend.do_connect for connection parameter information.

ibis.duckdb.connect is a thin wrapper around ibis.backends.duckdb.Backend.do_connect.

Connection Parameters

do_connect(self, path=':memory:', read_only=False)

Create an Ibis client connected to a DuckDB database.

Parameters

path Path to a duckdb database read_only Whether the database is read-only

Backend API

Backend (BaseAlchemyBackend)

Attributes

version: str property readonly

Return the version of the backend engine.

For database servers, return the server version.

For others such as SQLite and pandas return the version of the underlying library or application.

Returns

str The backend version

Methods

current_database(self)

The name of the current database this client is connected to.

register(self, path, table_name=None)

Register an external file as a table in the current connection database

Parameters

path Name of the parquet or CSV file table_name Name for the created table. Defaults to filename if not given. Any dashes in a user-provided or generated name will be replaced with underscores.

Returns

ir.Table The just-registered table


Last update: April 9, 2022