Skip to main content

2 posts tagged with "logging"

View All Tags

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.

DuckDB Integration and Request Logging

· One min read
TeaQL Code Gen
Core Contributor

DuckDB embedded analytical database integration, plus comprehensive request logging infrastructure.

DuckDB Integration

+ teaql-duck: DuckDB repository implementation
+ Embedded analytical database support

DuckDB is ideal for OLAP analytical workloads.

Sub-View Support

Views now support nested sub-views:

+ Sub-view fields in templates
+ Sub-view action candidates
+ Empty view customization per context
+ Go-to-view navigation

Request Logging and Tracing

+ Request body caching for logging
+ Response header debug logging
+ Client IP tracking in UserContext
+ MDC trace headers (trace_id, span_id)
+ Response body logging

Toast Messages

Toast/notification message support in the view rendering system.

UserContext Edit Hook

// Modify requests before execution
ctx.beforeExecuteRequest(request -> {
// Add default filters
// Audit logging
// Permission checks
});