Skip to main content

TeaQL Rust v0.7.0 Release

· One min read

TeaQL Rust reaches v0.7.0. The crates are published and documented.

Crate Structure

teaql-core                   // Entity traits, metadata, and core queries
teaql-sql // SQL dialect and AST-to-SQL compiler
teaql-runtime // UserContext, registry, graph writes, checkers, and events
teaql-macros // Derive macro for entity descriptors
teaql-provider-sqlx-postgres // PostgreSQL SQLx provider adapter
teaql-provider-sqlx-sqlite // SQLite SQLx provider adapter
teaql-provider-sqlx-mysql // MySQL SQLx provider adapter
teaql-provider-rusqlite // synchronous SQLite rusqlite provider adapter

Each crate has a standalone readme with examples.

Aggregation Cache

let cache = AggregationCache::new(CacheBackend::Memory)
.namespace("daily_revenue")
.ttl(Duration::from_secs(300));

let revenue: Decimal = cache
.get_or_compute(|| compute_daily_revenue())
.await?;

Namespaced caches prevent key collisions across different aggregations.

SQL Debug Logging

let ctx = UserContext::new()
.with_sql_debug(true);

// Logs: SELECT id, name FROM user_t WHERE age >= ?
// Params: [18]

Debug output shows the final SQL and bound parameters. Toggle per request via UserContext.

Extended Query Expressions

let expr = User::age()
.gte(18)
.and(User::status().in_vec(&["active", "premium"]))
.or(User::role().eq("admin"));

in_vec, between, like, and nested and/or groups are now supported.

v0.7.1 Patch

Quick patch for documentation links. No functional changes.

What's Next

Repository module split and open source cleanup.