Skip to main content

harlequin-odbc-vertica

PyPI CI

A Harlequin adapter for Vertica via ODBC.

This adapter extends harlequin-odbc to fix Vertica-specific issues with catalog and column metadata retrieval.

Problem

The standard harlequin-odbc adapter has two issues when used with Vertica:

  1. Empty Data Catalog: Vertica's ODBC driver returns None for catalog names, causing all tables to be filtered out.
  2. Column listing error: Vertica's ODBC driver does not support the catalog parameter in SQLColumns, resulting in HYC00 errors.

Solution

harlequin-odbc-vertica overrides two methods in the ODBC adapter:

  • _list_tables: Resolves SELECT current_database() before streaming SQLTables metadata, then uses it when the catalog name is None. Vertica cannot execute another query on the same connection while that metadata result is active.
  • _list_columns_in_relation: Omits the catalog parameter when calling pyodbc.Cursor.columns().

Installation

Three separate components are required:

  1. Harlequin and this Python plug-in: odbc-vertica is the Harlequin adapter name. Installing the plug-in also installs its harlequin-odbc and pyodbc dependencies; it does not install a Vertica database driver.
  2. An ODBC driver manager: unixODBC locates and loads registered native drivers. odbcinst is its configuration/query utility, not a driver.
  3. The native Vertica ODBC driver: a separate library supplied by Vertica. It must be loadable by the driver manager and registered under the name Vertica, which matches DRIVER={Vertica} in the connection string.

1. Install Harlequin, unixODBC, and the plug-in

On macOS with Homebrew:

brew install harlequin unixodbc

On Debian/Ubuntu, install the driver manager with sudo apt install unixodbc; install Harlequin using its installation instructions. Neither package manager command above installs the native Vertica driver.

Install this plug-in in the same Python environment as Harlequin. For a virtual environment containing Harlequin:

python -m pip install harlequin-odbc-vertica

For a Homebrew-installed Harlequin, pip on your shell's PATH may point to a different Python. Use the interpreter from Harlequin's entry-point script:

HARLEQUIN_PYTHON="$(head -n 1 "$(command -v harlequin)" | sed 's/^#!//')"
"$HARLEQUIN_PYTHON" -m pip install harlequin-odbc-vertica

If installing Harlequin as a uv tool instead:

uv tool install harlequin --with harlequin-odbc-vertica

After a Homebrew upgrade replaces Harlequin's environment, reinstall the plug-in into the new environment. harlequin --version should list odbc-vertica under installed adapters.

2. Install and register the native Vertica driver

Obtain the ODBC driver for your operating system from the Vertica client-driver installation documentation. Follow the vendor's installer instructions. On macOS, ensure the driver library supports the architecture of the Python process running Harlequin: an x86_64-only library cannot be loaded into an arm64 process.

odbcinst -j       # locations used by this unixODBC installation
odbcinst -q -d    # registered driver names; look for Vertica

If the vendor installer did not register Vertica with this unixODBC installation, add an entry to the odbcinst.ini shown as DRIVERS by odbcinst -j. Use the actual absolute path to the installed library (often .dylib on macOS or .so on Linux), not the example below:

[Vertica]
Description = Vertica ODBC driver
Driver = /absolute/path/to/installed/vertica-odbc-library
FileUsage = 1

The [Vertica] section is the name referenced by DRIVER={Vertica}; the Driver value is a filesystem path, not harlequin-odbc-vertica. A DSN in odbc.ini is not required when passing a full connection string. After registration, rerun odbcinst -q -d and check that the library path exists. Listing a driver confirms its registration, not that it can load or connect.

macOS with Homebrew unixODBC

The macOS Vertica .pkg may register its driver in /etc/odbcinst.ini, while Homebrew unixODBC reads /opt/homebrew/etc/odbcinst.ini on Apple Silicon. If odbcinst -j points there and odbcinst -q -d does not show [Vertica], register the installed /Library/Vertica/ODBC/lib/libverticaodbc.dylib in Homebrew's odbcinst.ini using the [Vertica] section above.

Registration alone may still leave SQLDriverConnect failing with ('H000', '[H000] [ (50404) (SQLDriverConnect)'): the vendor's default vertica.ini uses iODBC (UTF-32), whereas Homebrew pyodbc uses unixODBC. Run mkdir -p ~/.config/vertica and create ~/.config/vertica/vertica.ini with:

[Driver]
ErrorMessagesPath=/Library/Vertica/ODBC/messages/
ODBCInstLib=/opt/homebrew/lib/libodbcinst.2.dylib
DriverManagerEncoding=UTF-16

Launch Harlequin with the example profile below and the new file:

export VERTICAINI="$HOME/.config/vertica/vertica.ini"
harlequin -P vertica

This avoids editing the root-owned vendor file. Check that the configured path exists. On other architectures or Homebrew prefixes, use the actual path to the installed unixODBC library. Check the fix by launching Harlequin with a valid profile: a listed driver or a successful isql test alone does not prove Python's Unicode ODBC path works.

Usage

With a reachable Vertica server and valid credentials:

harlequin -a odbc-vertica 'DRIVER={Vertica};SERVER=your-server;PORT=5433;DATABASE=your-db;UID=user;PWD=your-password'

Real passwords in command-line arguments can appear in shell history and process listings. For regular use, add a profile to a private Harlequin config file (for example ~/.harlequin.toml) instead:

[profiles.vertica]
adapter = "odbc-vertica"
conn_str = ["DRIVER={Vertica};SERVER=your-server;PORT=5433;DATABASE=your-db;UID=user;PWD=your-password"]

Replace the placeholders locally, restrict the file with chmod 600 ~/.harlequin.toml, and launch with harlequin -P vertica.

Troubleshooting

  • "Could not load an adapter named odbc-vertica": the plug-in is missing from the Python environment used by the harlequin executable. Check harlequin --version and reinstall into that environment as above.
  • odbcinst -q -d reports SQLGetPrivateProfileString failed: inspect the DRIVERS path from odbcinst -j; no driver definitions may be available to this unixODBC installation. Install/register the native driver as described above.
  • "[unixODBC][Driver Manager] Can't open lib 'Vertica'": the native driver is missing, unregistered, or points to a library that cannot be loaded. Check odbcinst -j, odbcinst -q -d, the Driver path, and the library's architecture (file /absolute/path/to/installed/library).
  • H000 / 50404 after registering the driver on macOS: check VERTICAINI and Homebrew unixODBC encoding.
  • Connection/authentication error after the driver loads: check the server, port, database, credentials, and network access; registering a driver does not establish a database connection.
  • Empty catalog or column metadata errors with -a odbc: use -a odbc-vertica, which applies the Vertica-specific metadata fixes.
  • Catalog error (20) executing SELECT current_database(): older adapter builds issue this query while iterating SQLTables on the same connection. Install a build containing the cursor-ordering fix into Harlequin's Python environment and restart Harlequin. This source resolves the database name before starting the table metadata result.

License

MIT

Metadata

Release files for harlequin-odbc-vertica 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for harlequin-odbc-vertica 0.1.2
File Size Uploaded Provenance Actions
harlequin_odbc_vertica-0.1.2.tar.gz 7.0 kB With provenance Details for harlequin_odbc_vertica-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for harlequin-odbc-vertica 0.1.2
File Interpreter ABI Platform Actions
harlequin_odbc_vertica-0.1.2-py3-none-any.whl Python 3 none any Details for harlequin_odbc_vertica-0.1.2-py3-none-any.whl

Total release size: 14.1 kB

Release files / harlequin_odbc_vertica-0.1.2.tar.gz

Download URL harlequin_odbc_vertica-0.1.2.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
36fa29bfd2eeaf61ae274d10c30887a05a5caea43d599d93d8cd0d22aea1618c
BLAKE2b-256 checksum
How to use checksums
003e709f08ff5d00abdc4a228ef734b95ad85636342bb6541c575e56fe758023
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / harlequin_odbc_vertica-0.1.2-py3-none-any.whl

Download URL harlequin_odbc_vertica-0.1.2-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32e8e5f29b6ba9ae90e59f64ad0a036fd150de8fa3dab92249489b13f890c176
BLAKE2b-256 checksum
How to use checksums
9f73ffe5f6fbb2c7041e68c49a3d91ec050f7a60567dbffc08b4f910627ebb89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for harlequin-odbc-vertica 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for harlequin_odbc_vertica-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page