Skip to main content

Cookbook

The cookbook collects practical tasks and points each one to the best existing TeaQL docs. It is intentionally more task-oriented than a reference manual.

Build an Order List Page

Use nested selection, filtering, pagination, and count/statistics in one generated query expression.

Start with:

Count Orders by Status

Use generated count and group-by methods:

Q.orders()
.count()
.groupByOrderStatus()
.executeForList(ctx);

Read:

Load Top 3 Items for Each Order

Use nested list selection with limit:

Q.ordersWithId()
.selectLineItemList(
Q.lineItemsWithId()
.selectImageURL()
.limit(3)
);

Read:

Query Objects That Have Children

Use generated list-existence methods when available, such as hasOrders().

Read:

Query Objects That Have No Children

Use generated negative list-existence methods when available, or wrap the reusable business constraint in a query util method.

Read:

Generate Dashboard Statistics

Use count, sum, avg, min, max, and groupBy methods generated from the domain model.

Read:

Add Transaction Support

Keep transaction boundaries in the service/runtime layer rather than scattering them through controllers.

Read:

Add Cache Support

Put cache behavior behind runtime/context customization.

Read:

Use TeaQL with PostgreSQL

For Java data-service concepts, start with:

For Rust providers, use:

Use TeaQL with MySQL

For Java multi-database notes, start with:

For Rust providers, use:

Use TeaQL with SQLite SQLx

Use SQLx SQLite for local-first apps, tests, and lightweight services.

Read:

Use TeaQL with rusqlite

Use rusqlite when embedded, edge, synchronous execution, or multi-architecture deployment matters.

Read:

Use MemoryRepository for Tests

Use MemoryRepository to validate generated API behavior without a database.

Read:

Use TeaQL as Agent Memory

Use generated business APIs to keep agent memory structured, queryable, and provider-backed.

Read: