qail-redis
⚠️ ALPHA - Early development. API may change.
"Redis stores time — QAIL decides."
Native Redis driver using the unified QAIL AST. Part of the QAIL decision layer: PostgreSQL (facts) + Qdrant (meaning) + Redis (time).
Installation
[]
= "0.14"
Quick Start
use ;
use *;
async
The QAIL Decision Layer
qail-redis is designed to work alongside qail-pg and qail-qdrant for unified data access:
use *;
use PgDriver;
use QdrantDriver;
use ;
// Connect to all three backends
let pg = connect.await?;
let qdrant = connect.await?;
let mut redis = connect.await?;
// PostgreSQL: Facts (persistent relational data)
let users = pg.query.await?;
// Qdrant: Meaning (semantic similarity)
let similar = qdrant.search.await?;
// Redis: Time (ephemeral state, caching, sessions)
redis.execute.await?;
let cached = redis.get_str.await?;
Same Qail type. Same philosophy. Different backends.
Available Commands
| Command | Qail Constructor | Description |
|---|---|---|
| GET | Qail::redis_get("key") |
Get value |
| SET | Qail::redis_set("key", value) |
Set value |
| SET EX | .redis_ex(seconds) |
With TTL |
| SET NX | .redis_nx() |
Only if not exists |
| SET XX | .redis_xx() |
Only if exists |
| DEL | Qail::redis_del("key") |
Delete key |
| INCR | Qail::redis_incr("key") |
Increment |
| DECR | Qail::redis_decr("key") |
Decrement |
| TTL | Qail::redis_ttl("key") |
Get TTL |
| EXPIRE | Qail::redis_expire("key", 60) |
Set TTL |
| EXISTS | Qail::redis_exists("key") |
Check existence |
| PING | Qail::redis_ping() |
Health check |
Connection Pooling
use ;
let pool = new;
let mut conn = pool.get.await?;
conn.set.await?;
// Connection returns to pool on drop
Features
- Unified Qail AST: Same
Qailtype as PostgreSQL and Qdrant - Native RESP3: Direct wire protocol encoding (no string parsing)
- Connection Pooling:
RedisPoolwith semaphore concurrency - Fluent API:
RedisExttrait for.redis_ex(),.redis_nx(), etc. - Async/Await: Built on Tokio
License
MIT OR Apache-2.0