Skip to main content

TypeScript Quick Start

The TypeScript runtime is published on npm. The deployed generator may select an older package than npm's latest release; consult Latest Versions and first use the dependency emitted by the generated workspace.

Before you start​

Complete Prepare the Client and Starter Model first. You need the Cargo-based TeaQL client, your language toolchain, and the school model saved as models/main.xml. Run the commands below from that project root. The shared setup explains why cargo teaql is used for every language.

Generate the library and application​

cargo teaql services
cargo teaql evaluate --input models/
cargo teaql typescript-lib-core --input models/ --output generated/typescript-lib-core
cargo teaql typescript-app-console --input models/ --output generated/typescript-app-console

Build and start the console​

The console generated on 2026-10-26 provides build and start scripts. It contains its generated library and has no test script or lock file on first extraction. From the project root:

cd generated/typescript-app-console
npm install
npm run build
npm start
cd ../..

Keep the resulting lock file; use npm ci for subsequent installs. A successful build finishes with exit code 0. The current console prints a readiness message and entity count, but does not install the module, connect a SQL provider, or ensure schema. Treat it as a scaffold. Follow the next section to wire SQLite through Assist and verify a query and audited save before claiming a working database application.

Read the generated application's README, manifest, and any supplied AGENTS.md before changing application code. If a later template changes its scripts, use that manifest rather than inventing a missing command.

Query and save through Assist​

Do not use generated library source to discover model-specific methods. Request entity-level Assist, then field-level Assist only as needed:

cargo teaql typescript-assist-query/school --input models/
cargo teaql typescript-assist-query/school.name --input models/
cargo teaql typescript-assist-ensure-schema --input models/

For Node SQL, install the generated Runtime Module and explicitly call the context-aware module-level schema operation. Verify first and repeated root / constant seeding, a bounded Q query, loaded E expression, Checker/Fix, and an audited create/update through the generated application. Keep comment and purpose non-empty and execute using trusted context.

Browser code uses the browser-safe profile: it must not import Node SQL providers or receive database credentials. Browser federation and browser-local SQLite are separate integration paths; do not infer that a Node SQL test proves either browser path. Continue with TypeScript First Verification.

Learn through an Order​

Follow the Order tutorial to download a complete source package, install locked public npm dependencies with Node 22.23.4, and perform the first SQLite read and audited quantity/total edit. The package uses published @teaql/teaql 0.3.1 under its retained teaql-ts alias; no retained workspace or generator account is required for this fixed example. Use the Order API usage guide for result shapes and the native troubleshooting table for recovery. The coverage matrix tracks the remaining language packaging gaps. Later deletion/pagination/advanced Order runtime RELEASE PENDING and generator-deployment qualifications remain.