Skip to main content

TypeScript Runtime Guide

TeaQL TypeScript supports two deliberately separate profiles:

  • Node SQL runtime for PostgreSQL, MySQL and SQLite;
  • browser-safe generated domain client for TeaQL Federal Protocol calls.

The root/browser profile does not load Node database drivers. SQL providers are explicit subpath imports so client bundles do not accidentally acquire server-only dependencies.

Generated execution

Generated Requests receive a single UserContext. The context supplies trusted identity, policy and runtime resources; dynamic client JSON cannot replace them.

const orders = await Q.customerOrders()
.comment("Find orders awaiting review")
.purpose("Prepare the authorized review queue")
.executeForList(ctx);

Purpose transitions the Request to its executable state. Mutations require auditAs(...) before save. The runtime emits both an immutable mutation audit event and an independently attributable, metadata-masked application event.

Verified providers

DatabaseNode driver observed in acceptanceFeature status
PostgreSQLpg 8.23.0PASS
MySQLmysql2 3.23.3PASS
SQLitebetter-sqlite3 11.7.0PASS

TypeScript to Rust federation

The generated TypeScript domain client was also verified through the real TeaQL Federal Protocol /query path into a Rust backend using PostgreSQL. Direct Rust and federated canonical results matched. Attempts to override tenant, merchant, user, permissions, request policy, purpose policy or trusted context were rejected by the server.

This is protocol federation, not a generic HTTP feature wrapper. Keep server-owned context assembly on the Rust side and treat the client purpose as requested intent rather than approved policy.