swift-cloud / Upstash

A Upstash client compatible with Swift Cloud and Fastly Compute@Edge
MIT License
7 stars 0 forks source link

Upstash

A Upstash library compatible with all Apple platforms, Swift Cloud and Fastly Compute@Edge

Usage

Create a Client

let client = RedisClient(hostname: "my-host-12345.upstash.io", token: "...")

GET

let visits = try await client.get("visits").decode(Int.self)

SET

try await client.set("visits", 10)

EXEC

let visits = try await client.exec("incr", "visits").decode(Int.self)