Driver Manager
A driver manager is required to manage communication between applications and the ODBC driver. We tested and support unixODBC that is a complete ODBC driver manager for Linux. Users can install it from the command line:
On Debian-based distributions (Ubuntu, Mint, etc.), run:
sudo apt-get install unixodbc odbcinst On Fedora-based distributions (Amazon Linux, RHEL, CentOS, etc.), run:
sudo yum install unixODBC Setting Up the Driver
-
Download the ODBC Linux Asset corresponding to your architecture:
-
The package contains the following files:
libduckdb_odbc.so: the DuckDB driver.unixodbc_setup.sh: a setup script to aid the configuration on Linux.
To extract them, run:
mkdir duckdb_odbc && unzip duckdb_odbc-linux-amd64.zip -d duckdb_odbc -
The
unixodbc_setup.shscript performs the configuration of the DuckDB ODBC Driver. It is based on the unixODBC package that provides some commands to handle the ODBC setup and test likeodbcinstandisql.Run the following commands with either option
-uor-sto configure DuckDB ODBC.The
-uoption based on the user home directory to setup the ODBC init files../unixodbc_setup.sh -uThe
-soption changes the system level files that will be visible for all users, because of that it requires root privileges.sudo ./unixodbc_setup.sh -sThe option
--helpshows the usage ofunixodbc_setup.shprints the help../unixodbc_setup.sh --helpUsage: ./unixodbc_setup.sh <level> [options] Example: ./unixodbc_setup.sh -u -db ~/database_path -D ~/driver_path/libduckdb_odbc.so Level: -s: System-level, using 'sudo' to configure DuckDB ODBC at the system-level, changing the files: /etc/odbc[inst].ini -u: User-level, configuring the DuckDB ODBC at the user-level, changing the files: ~/.odbc[inst].ini. Options: -db database_path>: the DuckDB database file path, the default is ':memory:' if not provided. -D driver_path: the driver file path (i.e., the path for libduckdb_odbc.so), the default is using the base script directory -
The ODBC setup on Linux is based on the
.odbc.iniand.odbcinst.inifiles.These files can be placed to the user home directory
/home/⟨username⟩or in the system/etcdirectory. The Driver Manager prioritizes the user configuration files over the system files.For the details of the configuration parameters, see the ODBC configuration page.