{"id":29677269,"url":"https://github.com/valkey-io/valkey-swift","last_synced_at":"2026-02-24T11:12:39.215Z","repository":{"id":304792736,"uuid":"952477290","full_name":"valkey-io/valkey-swift","owner":"valkey-io","description":"Valkey client written in Swift","archived":false,"fork":false,"pushed_at":"2026-02-18T15:03:21.000Z","size":3733,"stargazers_count":120,"open_issues_count":18,"forks_count":20,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-02-18T15:14:13.149Z","etag":null,"topics":["swift","valkey","valkey-client","valkey-cluster"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valkey-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"Notice.txt","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-21T10:44:29.000Z","updated_at":"2026-02-18T10:43:12.000Z","dependencies_parsed_at":"2025-08-26T10:17:06.920Z","dependency_job_id":"3f9273cc-f210-4685-ba62-7f26f0305bf5","html_url":"https://github.com/valkey-io/valkey-swift","commit_stats":null,"previous_names":["valkey-io/valkey-swift"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/valkey-io/valkey-swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valkey-io","download_url":"https://codeload.github.com/valkey-io/valkey-swift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey-swift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29611011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T10:52:55.328Z","status":"ssl_error","status_checked_at":"2026-02-19T10:52:26.323Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["swift","valkey","valkey-client","valkey-cluster"],"created_at":"2025-07-23T00:35:08.025Z","updated_at":"2026-02-19T11:11:34.591Z","avatar_url":"https://github.com/valkey-io.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# valkey-swift\n\nA Swift client library for Valkey.\n\n## Usage\n\nThe valkey-swift project uses a connection pool, which requires a background process to manage it. You can either run it using a TaskGroup or async let. Below we are using async let to run the connection pool background process.\n\n```swift\nlet valkeyClient = ValkeyClient(.hostname(\"localhost\", port: 6379), logger: logger)\nasync let _ = valkeyClient.run()\n// use valkey client\n```\n\nOr you can use ValkeyClient with [swift-service-lifecycle](https://github.com/swift-server/swift-service-lifecycle).\n\nOnce you have a valkey client setup and running you can call valkey commands directly from the `ValkeyClient`.\n\n```swift\ntry await valkeyClient.set(key: \"foo\", value: \"bar\")\n```\nOr you can create a connection and run multiple commands from that connection using `ValkeyClient.withConnection()`.\n\n```swift\ntry await valkeyClient.withConnection { connection in\n    try await connection.set(key: \"foo1\", value: \"bar\")\n    try await connection.set(key: \"foo2\", value: \"baz\")\n}\n```\n\nAll the Valkey commands are in the Commands folder of the Valkey target. These are generated from the model files Valkey supplies in the [valkey](https://github.com/valkey-io/valkey/tree/unstable/src/commands) repository. In many cases where it was possible to ascertain the return type of a command these functions will return that expected type. In situations where this is not possible we have either added a custom return type or a `RESPToken` is returned and you'll need to convert it manually.\n\n### Pipelining commands\n\nIn some cases it is desirable to send multiple commands at one time, without waiting for the response after each command. This is called pipelining. You can do this using the function `execute(_:)`. This function takes multiple commands in the form of a parameter pack. It sends all the commands off at the same time and once it has received all the responses, returns a parameter pack containing the responses.\n\n```swift\nlet (setResponse, getResponse) = await connection.execute(\n    SET(key: \"MyKey\", value: \"TestString\"),\n    GET(key: \"MyKey\")\n)\nlet value = try getResponse.get()\n```\n\n## Redis compatibility\n\nAs Valkey is a fork of Redis v7.2.4, valkey-swift is compatible with Redis databases up to v7.2.4. There is a chance that v7.2.4 features will still be compatible in later versions of Redis, but these are now considered two different projects and they will diverge. valkey-swift uses the RESP3 protocol.\n\n## Documentation\n\nUser guides and reference documentation for valkey-swift can be found on the [Swift Package Index](https://swiftpackageindex.com/valkey-io/valkey-swift/documentation/valkey).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalkey-io%2Fvalkey-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalkey-io%2Fvalkey-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalkey-io%2Fvalkey-swift/lists"}