TeaQL Rust: From Java Feature Parity to Multi-database Runtime
TeaQL started with a mature Java implementation. The Rust work does not try to clone every Java framework feature. It carries over the high-level programming model and rebuilds the runtime in Rust.
That shift matters.
Java proved the generated business API style. Rust turns that style into a runtime direction for PostgreSQL, MySQL, SQLite, embedded SQLite, and memory-backed tests.
What Carries Over from Java
The useful Java ideas are not Spring-specific. They are TeaQL-specific:
- generated
QAPIs; - readable query builders;
- field and relation selectors;
SmartListstyle result metadata;- runtime context;
- checker infrastructure;
- translated validation messages;
- mutation events;
- graph writes;
- relation enhancement;
- relation aggregate enhancement;
- safe value access.
Rust implements those ideas with Rust types, traits, crates, and provider registration.
What Does Not Carry Over Directly
Some Java features should not be copied blindly:
- Spring Boot autoconfiguration;
- Java GraphQL generation;
- Java BaseService/controller conventions;
- reflection-style runtime mechanisms;
- the full Java database dialect matrix.
Rust needs a Rust-native shape. The runtime should be explicit, crate-based, and provider-backed.
The Rust Workspace
The Rust runtime is split by responsibility:
teaql-corefor metadata, values, query model, entity traits, andSmartList<T>;teaql-sqlfor SQL compilation and dialect behavior;teaql-runtimeforUserContext, repositories, checkers, events, relation enhancement, graph writes, and memory execution;teaql-macrosfor#[derive(TeaqlEntity)];- provider crates for SQLx PostgreSQL, SQLx MySQL, SQLx SQLite, and rusqlite SQLite.
This keeps the core runtime separate from database adapters.
Generated Rust Crates
teaql-code-gen can emit Rust service crates. A generated crate can include:
- entity structs;
Qfacade;- generated request builders;
- behavior skeletons;
- checker skeletons;
- runtime module registration;
- repository and behavior registries;
- provider-backed runtime helpers.
Application code then uses generated APIs:
let platforms = Q::platforms()
.select_merchant_list_with(
Q::merchants()
.select_name()
.which_names_contain("TeaQL"),
)
.execute_for_list(&ctx)
.await?;
Multi-database Runtime
The Rust direction is provider-based:
- SQLx PostgreSQL for production-grade PostgreSQL backends;
- SQLx MySQL for common enterprise MySQL systems;
- SQLx SQLite for local-first apps, tests, and small services;
- rusqlite SQLite for embedded and multi-architecture deployments;
- MemoryRepository for no-database tests and demos.
The generated API should stay stable while the provider changes below it.
Current State
The Rust runtime is already useful for core generated-domain paths:
- typed queries;
- relation loading;
- grouped aggregates;
- graph writes;
- checkers;
- events;
- schema bootstrap;
- SQL debug logs;
- generated high-level
QAPI validation against SQLite and PostgreSQL paths.
Full Java feature parity is not the only metric. The better metric is whether Rust has a coherent generated business API runtime.
That is now the direction.
