Skip to content

Latest commit

 

History

History
85 lines (57 loc) · 2.58 KB

File metadata and controls

85 lines (57 loc) · 2.58 KB

Connecting JavaScript and Teradata with ADBC

Instructions

Tip

If you don't already have a Teradata instance running, we recommend signing up for a free ClearScape Analytics trial.

Prerequisites

  1. Install Node.js (version 22 or later)

    • Alternatively, you can use Bun or Deno
  2. Install dbc

Connect to Teradata

  1. The ADBC driver for Teradata is available from Columnar's private driver registry. Create a Columnar Console account and activate a 14-day free trial. Then authenticate to the registry:

    dbc auth login
  2. Install the ADBC driver for Teradata:

    dbc install teradata
  3. Download and install the Teradata Tools and Utilities (TTU). Select "Tools and Utilities" and choose the package for your platform. Install to the default location:

    • Linux: /opt/teradata
    • macOS: /Library/Application Support/teradata
    • Windows: C:\Program Files\Teradata\Client

    On Windows, you can do this with winget install Teradata.TTUBase

    On macOS with Homebrew, you can do this with brew tap Teradata/teradata && brew install ttubasesuite

  4. Set LD_LIBRARY_PATH (Linux), DYLD_LIBRARY_PATH (macOS), or PATH (Windows) to make sure the TTU libraries are discoverable by your application.

  5. Install dependencies:

    npm --prefix .. install
  6. Customize the script main.js:

    • Change the connection arguments in databaseOptions
      • uri is the URI of your Teradata instance. The format is teradata://user:password@host[:port]
    • Change the SQL SELECT statement in conn.query()
  7. Run the script:

    Node.js:

    node main.js

    Bun:

    bun run main.js

    Deno:

    deno run --allow-ffi --allow-env main.js