SwiftyRedis is an asynchronous Redis library for Swift, designed to streamline your interactions with Redis databases. Drawing inspiration from the redis-rs Rust crate, SwiftyRedis offers a high-level interface to Redis functionality while preserving low-level flexibility. It is tailored to enhance your development experience by providing a very flexible type conversion protocol as well as modern async-await patterns.
To integrate SwiftyRedis into your project, you can use the Swift Package Manager. Simply add the following dependency to your Package.swift
file:
.package(url: "https://github.com/michaelvanstraten/swifty-redis.git", from: "0.3.0")
Then, in your target's dependencies array, add "SwiftyRedis"
as a dependency:
.target(
name: "YourApp",
dependencies: ["SwiftyRedis"]),
Once you've added the dependency, import SwiftyRedis and begin using it in your code:
import SwiftyRedis
let client = RedisClient(.init("localhost"))
let connection = try await client.getConnection()
let value: String = try await connection.hget("myhash", "field1")
Comprehensive documentation is available here, or you can conveniently access it through the link in the "About" section on the right.
We greatly appreciate your interest in contributing to SwiftyRedis! To get started, we recommend exploring the documentation provided above. While the documentation might not cover every detail, it contains valuable insights. Here are some areas where your contributions can make a meaningful impact:
To start contributing, run the following command to clone the repository:
git clone --recurse-submodules https://github.com/michaelvanstraten/swifty-redis.git
If you are interested in the automatic code generation package we developed to stay up to date with the latest Redis versions, navigate to the Sources/CodeGen
directory.
We invite you to contribute to the project and enhance the library's functionality!
Please Note: The information in this readme is accurate as of September 2023.
link |
Stars: 14 |
Last commit: 16 weeks ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics