Skip to Content
Next — You're reading the unreleased preview docs. APIs and pages may change before the next release.Switch to the current docs →
How-To GuidesTypeScriptUsing Apache Ignite from a TypeScript Agent

Using Apache Ignite from a TypeScript Agent

The TypeScript SDK ships a typed Apache Ignite 2 helper built on the golem:rdbms/ignite2@1.5.0 host interface. Connection queries and transaction commit/rollback return promises. Transaction query, queryValues, execute, and run are synchronous. Connection close() is currently a synchronous no-op; resources are GC-managed, not deterministically released by close(). Failures throw a typed IgniteError.

Imports

import { Ignite } from "@golemcloud/golem-ts-sdk";
  • Ignite.open(url, options?) — open a connection.
  • Ignite.* — explicit rich-type parameter wrappers (Ignite.string, Ignite.int, Ignite.uuid, …).

Open a Connection

Ignite uses thin-client URLs like ignite://host:10800.

const conn = await Ignite.open("ignite://127.0.0.1:10800");

Query Data

Ignite placeholders use ?. Plain JS values are encoded automatically (string → db-string, integer → db-int/db-long, etc.); wrap a value in an Ignite.* helper to pin an exact type. Rows come back as decoded { columnName: value } records.

const result = await conn.query('SELECT ? AS "message"', ["hello"]); const message = result.rows[0]?.message as string;

Quote aliases to preserve their case; Ignite uppercases unquoted identifiers.

Execute Statements

Include WITH "CACHE_NAME=..." when creating tables through Ignite SQL.

await conn.execute( `CREATE TABLE IF NOT EXISTS notes ( id INT PRIMARY KEY, body VARCHAR ) WITH "CACHE_NAME=notes"`, );

SQL Transaction Limits

The SDK exposes transaction, begin, commit, and rollback, but these do not guarantee SQL atomicity on Ignite 2.17. Verify commit and rollback behavior for the deployed server version, cache configuration, and thin-client path before relying on a SQL transaction.

The test framework enables IGNITE_ALLOW_DML_INSIDE_TRANSACTION for DML inside transactions over TRANSACTIONAL caches; neither alone guarantees SQL rollback. The table above does not configure that cache mode. The upstream JDBC documentation  describes a different client path, not this thin-client API.