teaql-runtime
Minimal runtime repository and graph persistence layer for TeaQL Rust.
teaql-runtime owns TeaQL's runtime concepts: metadata lookup, repository
assembly, behaviors, checkers, events, graph planning, and in-memory execution.
Database execution is supplied by provider crates.
What It Provides
UserContextfor metadata, typed resources, request locals, and runtime options- repository registry and behavior registry
- memory repository for tests and lightweight execution
- checker registry and translated validation results
- entity event sink support
- graph save planning and execution
- typed entity graph extraction
- SQL debug logging options on
UserContext
Source Layout
The repository layer is split by concern under src/repository/:
types.rs: public repository structs and relation load plan typesexecutor.rs:QueryExecutorand graph transaction boundary typescache.rs: aggregation cache traits and in-memory cachebase.rs: metadata-backedRepositorycompile and CRUD helperscontext.rs:UserContextrepository assembly and context repository logging/cache invalidationresolved.rs: entity-scoped repository query and mutation entry pointsgraph.rs: graph planning, graph save execution, and graph node validationrelation.rs: relation plans, relation enhancement, child queries, and relation aggregateshelpers.rs: shared bucket keys, cache keys, projection helpers, and graph relation validation
Example
use ;
let mut ctx = new
.with_metadata;
ctx.enable_all_sql_log;
let logs = ctx.sql_logs;
assert!;
With generated code, applications typically register a generated runtime module and then use generated entity/request helpers:
let ctx = new
.with_module
.with_repository_registry;
Database, cache, message, search, AI, and filesystem integrations live outside this crate as runtime providers/adapters. For SQLx-backed databases, choose one database-specific provider crate:
= "0.7"
= "0.7"
= "0.7"
= "0.7"
Provider crates expose a small registration helper. Runtime code registers whichever provider the application selected, then calls the database-neutral schema entry point:
use ;
use ;
let mut ctx = new
.with_module
.with_repository_registry;
ctx.use_postgres_provider;
ctx.ensure_schema.await?;
The provider-specific helpers remain available for low-level use, but
application code should prefer ctx.ensure_schema().await? once a provider is
registered.
teaql-runtime itself no longer has a sqlx feature and no longer exports
sqlx_support.