@exasol/exasol-driver-ts
    Preparing search index...

    @exasol/exasol-driver-ts

    Exasol TypeScript / JavaScript Driver

    The Exasol driver lets Node.js and browser applications connect to Exasol and execute SQL.

    Entry Points

    Use @exasol/exasol-driver-ts in Node.js for the complete API, including local file import and export. Use @exasol/exasol-driver-ts/browser in browser applications; it exports the driver and pool core without Node.js file or TLS modules. Both entry points require an explicit WebSocket factory.

    GitHub repository · User guide

    • ExasolDriver — create a database connection and execute SQL.
    • ExasolPool — manage a pool of database connections.
    • Config — configure the driver connection.
    • IExasolDriver — driver operations exposed by ExasolDriver.
    • IStatement — execute and close prepared statements.

    Import from @exasol/exasol-driver-ts/browser for browser-compatible database access. This entry point excludes local file import/export and Node.js TLS modules.

    • ExasolDriver — create a browser-compatible database connection and execute SQL.
    • ExasolPool — manage browser-compatible database connections.
    • IExasolClient — browser-safe driver operations.

    Install the driver and the Node.js WebSocket implementation:

    npm install @exasol/exasol-driver-ts ws @types/ws
    

    Connect, execute a query, and close the driver when finished:

    import { ExasolDriver, ExaWebsocket } from '@exasol/exasol-driver-ts';
    import { WebSocket } from 'ws';

    const driver = new ExasolDriver(
    (url) => new WebSocket(url) as ExaWebsocket,
    { host: 'localhost', port: 8563, user: 'sys', password: 'exasol' },
    );

    await driver.connect();
    await driver.query('SELECT * FROM EXA_ALL_SCHEMAS');
    await driver.close();

    Install the driver; browsers provide the WebSocket implementation:

    npm install @exasol/exasol-driver-ts
    

    Use the browser entry point and the runtime-native WebSocket:

    import { ExasolDriver, ExaWebsocket } from '@exasol/exasol-driver-ts/browser';

    const driver = new ExasolDriver(
    (url) => new WebSocket(url) as ExaWebsocket,
    { host: 'localhost', port: 8563, user: 'sys', password: 'exasol' },
    );

    await driver.connect();
    await driver.query('SELECT * FROM EXA_ALL_SCHEMAS');
    await driver.close();