Skip to content

TypeScript client

Package: @eelden/client (clients/typescript).

Surfaces

ExportRole
MoneyImmutable money (bigint minors + currency)
eelden\…``Tagged template → EeldenQuery (escape hatch)
EeldenExecutorTransport interface (execute / atomic)
eelden-codegenCLI for named-query (+ escape-hatch) codegen

Preferred path — named queries

  1. Write schemas + named queries as .eel
  2. Run eelden-codegen --config eelden.config.json
  3. Import generated functions; pass them to an EeldenExecutor
ts
import { GetPaid } from "./generated/users.queries";

const rows = await exec.execute(GetPaid({ min_balance: Money.usd(50_00n) }));
// rows typed from the query's select shape

See Named queries.

Escape hatch

ts
import { eelden } from "@eelden/client";

const q = eelden`users |> select { id, name }`;
// await exec.execute(q)

Use for one-offs and tests — not day-to-day app queries. Until a build plugin lands, result types default to unknown[] unless codegen wraps them.

Transport reality

EeldenExecutor is the contract. A shipping HTTP/IPC driver is not in the package yet (Phase 5). Today you:

  • drive the engine via eelden run / Studio / wasm ABI, or
  • implement EeldenExecutor against eelden serve's /query for experiments.

Money

ts
import { Money } from "@eelden/client";

const price = Money.usd(4999n); // $49.99

Cross-currency arithmetic is rejected at the type/runtime boundary — same doctrine as the language.

Pre-alpha. Local-first. Stdlib-only Rust engine.