DuckDB Support#
Available for: C/C++, GLib/Ruby, Go, Python, R
DuckDB provides ADBC support since version 0.8.0.
Note
DuckDB is not part of the Apache Arrow project and is developed separately.
Installation#
See the DuckDB documentation.
Usage#
ADBC support in DuckDB requires the driver manager.
See the DuckDB C++ documentation.
You must have libduckdb.so
on your LD_LIBRARY_PATH
, or
in the same directory as the executable when you run this. This
requires CGO and loads the DuckDB driver.
import (
"context"
"github.com/apache/arrow-adbc/go/adbc"
"github.com/apache/arrow-adbc/go/adbc/drivermgr"
)
func main() {
var drv drivermgr.Driver
db, err := drv.NewDatabase(map[string]string{
"driver": "libduckdb.so",
"entrypoint": "duckdb_adbc_init",
})
if err != nil {
// handle error
}
defer db.Close()
cnxn, err := db.Open(context.Background())
if err != nil {
// handle error
}
defer cnxn.Close()
}
You must have DuckDB 0.9.1 or higher.
See the DuckDB Python documentation.
You must have DuckDB 0.9.1 or higher.
# install.packages("duckdb")
library(adbcdrivermanager)
db <- adbc_database_init(duckdb::duckdb_adbc(), ...)
Supported Features#
ADBC support in DuckDB is still in progress. See duckdb/duckdb#7141 for details.