changed CHANGELOG.md
 
@@ -1,5 1,11 @@
1
1
# Changelog
2
2
3
## v1.5.0
4
5
### New features
6
7
* Add support for the `valkey://` scheme when using URIs.
8
3
9
## v1.4.2
4
10
5
11
### Bug fixes and improvements
changed README.md
 
@@ -9,7 9,7 @@
9
9
10
10
![dalle](https://user-images.githubusercontent.com/3890250/208236010-a89acc2a-ac79-44ca-9413-c1fa7c664ffe.jpg)
11
11
12
- Redix is a [Redis][redis] client written in pure Elixir with focus on speed, correctness, and resiliency (that is, being able to automatically reconnect to Redis in case of network errors).
12
Redix is a [Redis][redis] and [Valkey][valkey] client written in pure Elixir with focus on speed, correctness, and resiliency (that is, being able to automatically reconnect to Redis in case of network errors).
13
13
14
14
This README refers to the main branch of Redix, not the latest released version on Hex. Make sure to check [the documentation][docs] for the version you're using.
15
15
 
@@ -153,3 153,4 @@ Redix is released under the MIT license. See the [license file](LICENSE.txt).
153
153
[docker]: https://www.docker.com
154
154
[docker-compose]: https://docs.docker.com/compose/
155
155
[redis-terminology-issue]: https://github.com/antirez/redis/issues/5335
156
[valkey]: https://valkey.io/
changed hex_metadata.config
 
@@ -2,7 2,7 @@
2
2
[{<<"GitHub">>,<<"https://github.com/whatyouhide/redix">>},
3
3
{<<"Sponsor">>,<<"https://github.com/sponsors/whatyouhide">>}]}.
4
4
{<<"name">>,<<"redix">>}.
5
- {<<"version">>,<<"1.4.2">>}.
5
{<<"version">>,<<"1.5.0">>}.
6
6
{<<"description">>,<<"Fast, pipelined, resilient Redis driver for Elixir.">>}.
7
7
{<<"elixir">>,<<"~> 1.11">>}.
8
8
{<<"app">>,<<"redix">>}.
 
@@ -25,11 25,11 @@
25
25
{<<"repository">>,<<"hexpm">>}]]}.
26
26
{<<"files">>,
27
27
[<<"lib">>,<<"lib/redix">>,<<"lib/redix/protocol.ex">>,
28
- <<"lib/redix/connection.ex">>,<<"lib/redix/format.ex">>,
29
- <<"lib/redix/exceptions.ex">>,<<"lib/redix/telemetry.ex">>,
30
- <<"lib/redix/socket_owner.ex">>,<<"lib/redix/uri.ex">>,
31
- <<"lib/redix/connector.ex">>,<<"lib/redix/start_options.ex">>,
28
<<"lib/redix/telemetry.ex">>,<<"lib/redix/socket_owner.ex">>,
29
<<"lib/redix/format.ex">>,<<"lib/redix/start_options.ex">>,
32
30
<<"lib/redix/pubsub">>,<<"lib/redix/pubsub/connection.ex">>,
33
- <<"lib/redix/pubsub.ex">>,<<"lib/redix.ex">>,<<".formatter.exs">>,
31
<<"lib/redix/connection.ex">>,<<"lib/redix/uri.ex">>,
32
<<"lib/redix/exceptions.ex">>,<<"lib/redix/pubsub.ex">>,
33
<<"lib/redix/connector.ex">>,<<"lib/redix.ex">>,<<".formatter.exs">>,
34
34
<<"mix.exs">>,<<"README.md">>,<<"LICENSE.txt">>,<<"CHANGELOG.md">>]}.
35
35
{<<"build_tools">>,[<<"mix">>]}.
changed lib/redix.ex
 
@@ -1,6 1,7 @@
1
1
defmodule Redix do
2
2
@moduledoc """
3
- This module provides the main API to interface with Redis.
3
This module provides the main API to interface with [Redis](http://redis.io) and
4
[Valkey](https://valkey.io/).
4
5
5
6
## Overview
6
7
 
@@ -195,6 196,8 @@ defmodule Redix do
195
196
* `redis://:secret@localhost:6397`
196
197
* `redis://username:secret@localhost:6397`
197
198
* `redis://example.com:6380/1`
199
* `rediss://example.com:6380/1` (for SSL connections)
200
* `valkey://example.com:6380/1` (for [Valkey](https://valkey.io/) connections)
198
201
199
202
The only mandatory thing when using URIs is the host. All other elements are optional
200
203
and their default value can be found in the "Options" section below.
 
@@ -202,6 205,10 @@ defmodule Redix do
202
205
In earlier versions of Redix, the username in the URI was ignored. Redis 6 introduced [ACL
203
206
support](https://redis.io/topics/acl). Now, Redix supports usernames as well.
204
207
208
> #### Valkey {: .info}
209
>
210
> The `valkey://` schema is supported since Redix v1.5.0.
211
205
212
## Options
206
213
207
214
The following options can be used to specify the connection:
changed lib/redix/uri.ex
 
@@ -12,6 12,11 @@ defmodule Redix.URI do
12
12
13
13
redis://[username:password@]host[:port][/db]
14
14
15
> #### Valkey {: .tip}
16
>
17
> URIs also work with [Valkey](https://valkey.io/), a Redis-compatible in-memory key-value
18
> store. Use `valkey://` as the scheme instead of `redis://`.
19
15
20
## Examples
16
21
17
22
iex> Redix.URI.to_start_options("redis://example.com")
 
@@ -26,8 31,9 @@ defmodule Redix.URI do
26
31
def to_start_options(uri) when is_binary(uri) do
27
32
%URI{host: host, port: port, scheme: scheme} = uri = URI.parse(uri)
28
33
29
- unless scheme in ["redis", "rediss"] do
30
- raise ArgumentError, "expected scheme to be redis:// or rediss://, got: #{scheme}://"
34
unless scheme in ["redis", "rediss", "valkey"] do
35
raise ArgumentError,
36
"expected scheme to be redis://, valkey://, or rediss://, got: #{scheme}://"
31
37
end
32
38
33
39
{username, password} = username_and_password(uri)
changed mix.exs
 
@@ -5,7 5,7 @@ defmodule Redix.Mixfile do
5
5
6
6
@repo_url "https://github.com/whatyouhide/redix"
7
7
8
- @version "1.4.2"
8
@version "1.5.0"
9
9
10
10
def project do
11
11
[