{"id":13443085,"url":"https://github.com/artemeff/redis","last_synced_at":"2025-12-12T00:31:03.211Z","repository":{"id":9506162,"uuid":"11400514","full_name":"artemeff/redis","owner":"artemeff","description":"Redis commands for Elixir","archived":false,"fork":false,"pushed_at":"2024-01-30T06:26:37.000Z","size":195,"stargazers_count":357,"open_issues_count":7,"forks_count":63,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-19T00:35:38.544Z","etag":null,"topics":["elixir","elixir-lang","redis","redis-client"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artemeff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"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}},"created_at":"2013-07-14T08:42:36.000Z","updated_at":"2025-01-08T14:16:50.000Z","dependencies_parsed_at":"2024-05-01T17:21:06.907Z","dependency_job_id":"73256806-67db-433d-b1a5-951d739020ce","html_url":"https://github.com/artemeff/redis","commit_stats":null,"previous_names":["artemeff/exredis"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemeff%2Fredis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemeff%2Fredis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemeff%2Fredis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemeff%2Fredis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artemeff","download_url":"https://codeload.github.com/artemeff/redis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485025,"owners_count":22078764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["elixir","elixir-lang","redis","redis-client"],"created_at":"2024-07-31T03:01:55.839Z","updated_at":"2025-12-12T00:31:03.172Z","avatar_url":"https://github.com/artemeff.png","language":"Elixir","funding_links":[],"categories":["Elixir"],"sub_categories":[],"readme":"### Redis [![Build Status](https://img.shields.io/travis/artemeff/redis.svg)](https://travis-ci.org/artemeff/redis) [![Hex.pm](https://img.shields.io/hexpm/v/redis.svg)](https://hex.pm/packages/redis)\n\n---\n\n[Redis](http://redis.io) commands for Elixir. If you are looking for exredis, please check out [exredis](https://github.com/artemeff/exredis/tree/exredis) branch.\n\n---\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [API reference](http://hexdocs.pm/redis/)\n* [Contributing](#contributing)\n\n---\n\n### Installation\n\nAdd this to the dependencies:\n\n```elixir\n{:redis, \"~\u003e 0.1\"}\n```\n\n---\n\n### Usage\n\nRedis commands have a few simple types: enums, commands and primitive. Types can be required and optional, multiple and variadic, can be composite.\n\nSituation with required and optional types is simple: required types are just arguments in function and optional values passed with the last argument — `opts`. opts is just a list, opts described in typespecs for each command.\n\nMultiple arguments are arguments that contain one or more values. Multiple arguments can be optional.\n\nEnum types in Redis is just a enumerable (usually), take a look at `xx | nx` enum:\n\n```elixir\niex\u003e Redis.set(\"key\", \"value\", [:xx])\n[\"SET\", [\" \", \"key\"], [\" \", \"value\"], [], [\" \", \"XX\"]]\n\niex\u003e Redis.set(\"key\", \"value\", [:nx])\n[\"SET\", [\" \", \"key\"], [\" \", \"value\"], [], [\" \", \"NX\"]]\n```\n\nCommands are prefixed types, commands can wrap primitive types, enums and composite types:\n\n```elixir\n# command with enum inside\niex\u003e Redis.client_kill(type: :master)\n[\"CLIENT KILL\", [], [], [\" \", [\"TYPE\", \" \", \"master\"]], [], []]\n\n# command with primitive type inside\niex\u003e Redis.client_kill(id: \"identity\")\n[\"CLIENT KILL\", [], [\" \", [\"ID\", \" \", \"identity\"]], [], [], []]\n\n# command with composite type inside, inner type of get is: {String.t, integer()}\niex\u003e Redis.bitfield(\"key\", get: {\"type\", \"offset\"})\n[\"BITFIELD\", [\" \", \"key\"], [\" \", [\"GET\", \" \", [\"type\", \" \", \"offset\"]]], [], [], []]\n```\n\nYou can see the usage for every Redis command in IEx:\n\n```elixir\niex\u003e h Redis.set\n\n  def set(key, value, opts \\\\ [])\n\n  @spec set(\n          key :: key(),\n          value :: String.t(),\n          opts :: [\n            {:expiration, {:ex, :integer} | {:px, :integer}}\n            | (:nx | :xx)\n            | {:condition, :nx | :xx}\n          ]\n        ) :: iolist()\n\nsince: 1.0.0\n\nSet the string value of a key\n\nGroup: string.\n```\n\nOr head to the [documentation on hexdocs](http://hexdocs.pm/redis/).\n\n---\n\n### Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemeff%2Fredis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartemeff%2Fredis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemeff%2Fredis/lists"}