Skip to content

ODBC

The ODBC connector is a generic connector to connect to any datasource that supports the ODBC protocol. The main use case for this is to connect to datasources that do not have a dedicated connector in Katalogue.

The ODBC connector is based on the node-odbc package. This package is installed automatically with the Katalogue backend API service, but installing a database-specific ODBC driver that can be used by the ODBC connector involves these steps:

  1. Get the ODBC driver (and any license keys that might be required) for the datasource
  2. Install the ODBC driver on the machine that runs the katalogue-api service.
  3. Configure the driver in the ODBC driver manager on the machine
  4. Add the driver to the public.datasource_subtype table to let Katalogue use it

How to get the ODBC driver depends on the database vendor. Some are open source and free to use, some are proprietary and requires a valid license. Contact the database vendor to get more information.

How this is done depends on the OS that the katalogue-api service runs on. The recommended way to run the service is in a Linux (Debian)-based Docker container. See the /api/Dockerfile for an example of how to install an ODBC driver in a Docker image.

Again, how this is done depends on the OS. On Windows, the built in ODBC-manager is used. On Linux, the unixODBC driver manager is used. See the database vendors instructions and the /api/drivers/odbc*.ini files for an example of how to configure an ODBC driver for unixODBC.

Once the ODBC driver is installed and configured in the Katalogue API backend service, the last step is to tell Katalogue about it. This is done through the GUI:

  1. Go to Settings -> Connectors -> ODBC section (requires the Admin user role)
  2. Add a new driver:
  • Driver Name: Must exactly match the name of the driver that was set in the ODBC driver manager. Katalogue uses this name to pich up the driver, ex: “PostgreSQL 11 ODBC Driver”
  • Datasource Type: This will be used as the datasource type display name on datasource type icons in the GUI, ex: “PostgreSQL”
  • Connection String Property Map: Names of the ODBC connection string properties that correspond to hostname, port etc. This mapping is required for Katalogue to use the native datasource model with password encryption etc for the ODBC connector.

Once installed, the ODBC driver can be used as any other connector in Katalogue - with one major difference. The ODBC driver requires that a Custom Import and Custom Relationship SQL Query is provided to work, see the Custom Import Query section on how to provide one.