Search docs.molo17.com

    Gluesync ODBC driver

    The Gluesync ODBC driver lets any ODBC client query Query Forge, the federated SQL endpoint of Core Hub. Excel, Power BI, Tableau, Qlik, pyodbc, R and isql connect with nothing else installed: no JVM and no JDBC-ODBC bridge. It is the ODBC counterpart of the Gluesync JDBC driver, and it talks to Query Forge directly.

    Before you start

    • A Core Hub with Query Forge reachable from the machine that runs the client (default port 8765), or a Gluesync Connect relay URL.

    • A Personal API Token with the gluesync.jdbc_gateway scope. See Authentication.

    Supported platforms

    Platform Driver manager

    Windows x86_64 (64-bit only)

    The Windows ODBC Driver Manager. Use the 64-bit ODBC Data Sources tool.

    Linux x86_64 and aarch64

    unixODBC

    macOS

    unixODBC from Homebrew. There is no prebuilt macOS archive yet: build the driver from source.

    iODBC is not supported in the first version: its wide-character type is 32-bit, while the driver uses 16-bit wide characters like Windows and unixODBC. With iODBC only the ANSI entry points work.

    Download

    Platform Archive

    Windows x86_64

    gluesync-odbc-latest-windows-x86_64.zip

    Linux x86_64

    gluesync-odbc-latest-linux-x86_64.tar.gz

    Linux aarch64

    gluesync-odbc-latest-linux-aarch64.tar.gz

    Every release is also published as gluesync-odbc-<version>-<platform>.<extension> in the same folder. What changed in each version is in the ODBC driver changelog.

    Install on Windows

    1. Unzip the archive.

    2. Open an elevated PowerShell in the unzipped folder and run:

      .\scripts\install-windows.ps1

      The script registers the driver as Gluesync ODBC Driver under HKLM:\SOFTWARE\ODBC\ODBCINST.INI. Running it again is safe.

    To create a user DSN at the same time:

    .\scripts\install-windows.ps1 -DsnName GluesyncProd -Server corehub.example.com -Port 8765

    Pass -DriverPath C:\path\to\gluesync_odbc.dll to register a DLL kept somewhere else. .\scripts\install-windows.ps1 -Uninstall removes the registration; add -DsnName to remove that DSN too.

    Create a DSN in the ODBC Data Source Administrator

    1. Open ODBC Data Sources (64-bit).

    2. Pick the User DSN or System DSN tab and choose Add, or Configure on an existing DSN.

    3. Select Gluesync ODBC Driver. The driver’s own dialog opens.

    Field Notes

    Data source name

    Required.

    Description

    Optional.

    Server

    The Core Hub host. Leave it empty when the DSN already has a Url.

    Port

    The Query Forge port. Default 8765.

    Token

    Optional. Your Personal API Token (gsp_…​), stored as Token. Leave it empty to be asked when you connect.

    Trust server certificate

    Stores TrustServerCertificate=1.

    Other keys, such as Url, UID or FetchSize, are kept when you reconfigure a DSN. Add them with Add-OdbcDsn -SetPropertyValue. Excel, Power BI and the other tools that open the same dialog from their own connection screens use it too.

    When an application connects with a window and asks the driver to prompt, and the server or the token is missing, the same dialog opens without the name fields. Cancel ends the attempt without an error. On Linux and macOS the driver never opens a dialog: missing keys make the connection fail with a diagnostic.

    Install on Linux

    Install unixODBC (apt install unixodbc or dnf install unixODBC), unpack the archive and run:

    ./scripts/install-unixodbc.sh

    To create a user DSN at the same time:

    ./scripts/install-unixodbc.sh --dsn GluesyncProd --server corehub.example.com --port 8765

    The script registers libgluesync_odbc.so with odbcinst as Gluesync ODBC Driver. Pass --driver /path/to/libgluesync_odbc.so if the library lives elsewhere. Running it again is safe: the driver and the DSN are replaced by name.

    On macOS, install unixODBC with brew install unixodbc, then run the same script with the library you built, for example ./scripts/install-unixodbc.sh --driver "$PWD/target/release/libgluesync_odbc.dylib".

    Connect

    Connection string

    Driver={Gluesync ODBC Driver};Server=corehub.example.com;Port=8765;UID=__token__;PWD=gsp_...

    Or use a DSN: DSN=GluesyncProd;PWD=gsp_…​. Keys are case-insensitive. A key in the connection string wins over the same key in the DSN.

    Connection keys

    Key Meaning Default

    Server (Host)

    The Core Hub host.

    Required unless Url is set

    Port

    The Query Forge port.

    8765

    Url

    The full gateway URL, for example a Gluesync Connect relay https://<connect-host>/api/organizations/<org>/sites/<site>/jdbc.

    http://<Server>:<Port>/

    UID (User)

    The Core Hub user name. It only identifies you in the audit log; the token grants access.

    token

    PWD (Password)

    Your Personal API Token (gsp_…​).

    None

    Token

    The same as PWD, in a single field. It wins over PWD.

    None

    ConnectToken

    A Gluesync Connect relay token (gsj_…​), sent as Authorization: Bearer on every request.

    None

    MaxScanRows

    The scan cap for the connection. See Scan cap.

    Server default

    QueryTimeout

    The statement timeout, in seconds.

    Server default

    ResponseTimeout

    Milliseconds the driver waits for one response.

    600000, or QueryTimeout * 1000 + 60000 when that is larger

    FetchSize

    Rows per frame.

    1000

    TrustServerCertificate

    1 turns off TLS certificate verification for https URLs.

    0

    LogFile, LogLevel

    The driver trace file and its level: error, warn, info, debug or trace.

    Off

    A Url that is not on localhost, 127.0.0.1 or ::1 must use https. A Url with user information, a query string or a fragment is refused.

    Authentication

    Query Forge accepts only Personal API Tokens (gsp_…​). Password login is refused with SQLState 28000, and so is an expired or revoked token. Create a token in the Control Plane under JDBC > New token, or under Account > Personal API Tokens, and give it the gluesync.jdbc_gateway scope. See Personal API Tokens and scopes.

    Pass the token in either of two ways:

    • UID=<anything> and PWD=gsp_…​. This suits tools that show a user name and a password field, such as Excel and Power BI.

    • The single-field form Token=gsp_…​.

    You query as yourself: the connection shows only the agents your token can reach.

    Through Gluesync Connect

    To reach Core Hub through the Gluesync Connect relay, set Url to the relay’s gateway URL and ConnectToken to the relay token (gsj_…​). Keep the Personal API Token in PWD or Token. The relay URL must use https.

    Query from a client

    pyodbc

    import os
    import pyodbc
    
    conn = pyodbc.connect(
        "Driver={Gluesync ODBC Driver};Server=corehub.example.com;Port=8765;"
        f"UID=__token__;PWD={os.environ['GLUESYNC_PAT']}"
    )
    for row in conn.execute("SELECT * FROM crm.customers"):
        print(row)

    isql

    isql -v GluesyncProd __token__ gsp_...

    BI tools

    Excel, Power BI and Tableau use their generic ODBC connection.

    Power BI Desktop

    Choose Get Data > ODBC and pick the DSN. In the credentials dialog choose Database: any user name, and your Personal API Token as the password. Pick tables, or write a SQL statement under Advanced options.

    Excel

    Choose Data > Get Data > From Other Sources > From ODBC, pick the DSN, choose Database credentials with the same user name and password, then select a table or enter a SQL statement.

    Tableau

    Connect with the Other Databases (ODBC) connector, choose the DSN or the connection string, then use the token as the password.

    Keep queries cheap for these tools: Query Forge runs as much of each statement as it can on the source database. See Write fast queries from BI tools.

    What you query

    Query Forge exposes the SQL-capable agents you can reach as catalogs and schemas, with the tables behind them. Write names the way Query Forge shows them, quoting an identifier with " when it needs it, for example "<catalog>".schema.table. See Writing federated SQL for the naming rules; they are the same as for the JDBC driver.

    SQL clients show the driver with its version, and the server as Gluesync Query Forge with the Core Hub version (unknown with a Core Hub that does not report it).

    Limits

    • The data source is read-only. Committing a transaction succeeds and does nothing.

    • Cursors are forward-only: fetching supports SQL_FETCH_NEXT only.

    • Input parameters work one parameter set at a time. Data-at-execution parameters, explicit descriptors and SQLBrowseConnect are not supported.

    • The catalog functions for primary keys, foreign keys, statistics, special columns, procedures and privileges return empty result sets.

    • 64-bit only on Windows; iODBC is not supported.

    Errors

    The driver reports Query Forge’s SQLState in the ODBC diagnostic.

    SQLState Meaning What to do

    28000

    The token is missing, expired, revoked or not a Personal API Token.

    Create a token with the gluesync.jdbc_gateway scope and pass it as PWD or Token.

    42S02

    The table or schema does not exist, or your token cannot see it.

    Check the name and the agents your token may use.

    HYT00

    The driver waited longer than ResponseTimeout for Query Forge.

    Raise ResponseTimeout, or make the query cheaper.

    54000

    The query needed more rows from one table than the scan cap allows.

    Let the source do more of the work, or raise MaxScanRows. See Scan cap.

    Connection failures report 08001 while connecting and 08S01 afterwards. Other SQLStates are the ones listed in Troubleshooting.

    Driver updates

    The ODBC driver has its own version, separate from Core Hub. From Gluesync 2.3.3.0, when Core Hub can reach the Gluesync catalog and you have a Query Forge token, the Query Forge setup screen and toolbar in the Gluesync UI tell you when a newer driver is out, and what changed in it, the same way as for the JDBC driver. Open the notice to download the new version, then choose Mark as updated to hide it until the next release. See Driver versions and updates.

    Troubleshooting

    To record what the driver does, add LogFile and LogLevel to the connection string or the DSN:

    Driver={Gluesync ODBC Driver};Server=corehub.example.com;LogFile=C:\Temp\gluesync-odbc.log;LogLevel=debug;UID=__token__;PWD=gsp_...

    Use debug or trace only while you investigate: the file grows quickly. Common causes of a failed connection:

    • Driver not found: the driver is not registered. Run the install script again, and on Windows use the 64-bit ODBC tool and a 64-bit client.

    • The connection fails with a diagnostic about missing keys: set Server or Url, and a token.

    • 28000: see Authentication.

    • Certificate errors on https: install the CA that signed Core Hub’s certificate, or set TrustServerCertificate=1 for a test environment only.