Home Expressions
Docs
Drivers Gateway SDKs Benchmarks
Changelog
GitHub
Blog Status Roadmap

February 8, 2026 8 min read

Why Rust PostgreSQL Drivers Miss Row-Level Security

Multi-tenant isolation fails when tenant scoping is manual. QAIL solves this by attaching RLS context to the AST query itself.

PostgreSQLRLSRustMulti-tenant

Multi-tenant systems break when one query misses tenant scope. A missing WHERE clause can leak data across customers.

Why It Breaks in String-Based Drivers

QAIL Approach

QAIL uses typed AST queries, so tenant context is attached structurally to the query node with with_rls().

                            let ctx = RlsContext::tenant(tenant_id);
let q = Qail::get("bookings").with_rls(&ctx);
let rows = driver.query(&q).await?;
                        
Tenant isolation should be structural, not a memory test for engineers.
← Back to Blog