Available
amalgame-redis
Pure RESP2 client, no vendored lib. KeyDB/Dragonfly/Valkey compat.
Overview
The RESP2 protocol is written in the package, straight over raw TCP, on top of Amalgame's network layer. No client library (no hiredis), no system dependency. Compatible with Redis, KeyDB, Dragonfly, Valkey and any server speaking RESP2.
Features
- ✓RESP2 protocol written in the package: no hiredis to install
- ✓
Set/Get/Del/Exists/Incr/Decr/Expire/PingAPI - ✓Works with Redis, KeyDB, Dragonfly, Valkey — one client
- ✓Pub/sub and pipelining (v0.3.0)
Planned
- ◐
AUTHand database selection (SELECT) - ◐
MULTI/EXECtransactions - ◐TLS
Example
Minimal usage example — copy-paste runnable after install.
import Amalgame.Database.NoSQL.Redis
public class Program {
public static void Main() {
let r = Redis.Open("127.0.0.1", 6379)
if (!Redis.IsOpen(r)) {
Console.WriteLine("connect failed: " + Redis.LastError(r))
return
}
Redis.Set(r, "user:42", "Alice")
let name = Redis.Get(r, "user:42")
Console.WriteLine(name)
Redis.Expire(r, "user:42", 3600)
let visits = Redis.Incr(r, "visits")
Console.WriteLine("visits: " + String_FromInt(visits))
Redis.Close(r)
}
}
At a glance
- License: Apache-2.0
- Install:
amc package add redis - Source: amalgame-lang/amalgame-database-nosql-redis
- Official index: amalgame-lang/packages-index