Releases: redis-rs/redis-rs
v0.22.2
0.22.2 (2023-01-07)
This release adds various incremental improvements and fixes a few long-standing bugs. Thanks to all our
contributors for making this release happen.
Features
- Implement ToRedisArgs for HashMap (#722 @gibranamparan)
- Add explicit
MGET
command (#729 @vamshiaruru-virgodesigns)
Bug fixes
- Enable single-item-vector
get
responses (#507 @hank121314) - Fix empty result from xread_options with deleted entries (#712 @Quiwin)
- Limit Parser Recursion (#724)
- Improve MultiplexedConnection Error Handling (#699)
Changes
- Add test case for atomic pipeline (#702 @CNLHC)
- Capture subscribe result error in PubSub doc example (#739 @baoyachi)
- Use async-std name resolution when necessary (#701 @UgnilJoZ)
- Add Script::invoke_async method (#711 @r-bk)
- Cluster Refactorings (#717, #716, #709, #707, #706 @0xWOF, @utkarshgupta137)
- Fix intermitent test failure (#714 @0xWOF, @utkarshgupta137)
- Doc changes (#705 @0xWOF, @utkarshgupta137)
- Lint fixes (#704 @0xWOF)
v0.21.7
0.21.7 (2022-12-10)
This release addresses bugs related to server response parsing and MultiPlexedConnection
error handling.
Bug fixes
v0.22.1
0.22.1 (2022-10-18)
Changes
- Add README attribute to Cargo.toml
- Update LICENSE file / symlink from parent directory
v0.22.0
Redis-rs is a high level redis library for Rust and aims to provide
convenient access to all Redis functionality through a very flexible
but low-level API. The crate has recently come under maintainership
by @djc and @jaymell. Much appreciation and many thanks to @mitsuhiko,
@badboy, @Marwes for their work in building this library over the years! The
new maintainers hope to improve the velocity of bug fixes, new features, and
PR reviews in the coming months.
This release adds various incremental improvements, including
additional convenience commands, improved Cluster APIs, and various other bug
fixes/library improvements.
Although the changes here are incremental, this is a major release due to the
breaking changes listed below.
This release would not be possible without our many wonderful
contributors -- thank you!
Breaking changes
- Box all large enum variants; changes enum signature (#667 @nihohit)
- Support ACL commands by adding Rule::Other to cover newly defined flags; adds new enum variant (#685 @garyhai)
- Switch from sha1 to sha1_smol; renames
sha1
feature (#576)
Features
- Add support for RedisJSON (#657 @d3rpp)
- Add support for weights in zunionstore and zinterstore (#641 @ndd7xv)
- Cluster: Create read_from_replicas option (#635 @utkarshgupta137)
- Make Direction a public enum to use with Commands like BLMOVE (#646 @thorbadour)
- Add
ahash
feature for using ahash internally & for redis values (#636 @utkarshgupta137) - Add Script::load function (#603 @zhiburt)
- Add support for OBJECT ([#610] @Roger)
- Add GETEX and GETDEL support (#582 @arpandaze)
- Add support for ZMPOP (#605 @gkorland)
Changes
- Rust 2021 Edition / MSRV 1.59.0
- Fix: Support IPV6 link-local address parsing (#679 @buaazp)
- Derive Clone and add Deref trait to InfoDict (#661 @danni-m)
- ClusterClient: add handling for empty initial_nodes, use ClusterParams to store cluster parameters, improve builder pattern (#669 @utkarshgupta137)
- Implement Debug for MultiplexedConnection & Pipeline (#664 @elpiel)
- Add support for casting RedisResult to CString (#660 @nihohit)
- Move redis crate to subdirectory to support multiple crates in project (#465 @tdyas)
- Stop versioning Cargo.lock (#620)
- Auto-implement ConnectionLike for DerefMut (#567 @holmesmr)
- Return errors from parsing inner items (#608)
- Make dns resolution async, in async runtime (#606 @Roger)
- Make async_trait dependency optional (#572 @kamulos)
- Add username to ClusterClient and ClusterConnection (#596 @gildaf)
v0.13.0
Fixes and improvements
- Breaking change: rename
parse_async
toparse_redis_value_async
for consistency (ce59cecb). - Run clippy over the entire codebase (#238)
- Breaking change: Make
Script#invoke_async
generic overaio::ConnectionLike
(#242)
BREAKING CHANGES
Rename parse_async
to parse_redis_value_async
for consistency (ce59cecb).
If you used redis::parse_async
before, you now need to change this to redis::parse_redis_value_async
or import the method under the new name: use redis::parse_redis_value_async
.
Make Script#invoke_async
generic over aio::ConnectionLike
(#242)
Script#invoke_async
was changed to be generic over aio::ConnectionLike
in order to support wrapping a SharedConnection
in user code.
This required adding a new generic parameter to the method, causing an error when the return type is defined using the turbofish syntax.
Old:
redis::Script::new("return ...")
.key("key1")
.arg("an argument")
.invoke_async::<String>()
New:
redis::Script::new("return ...")
.key("key1")
.arg("an argument")
.invoke_async::<_, String>()
v0.12.0
Fixes and improvements
- Breaking change: Use
dyn
keyword to avoid deprecation warning (#223) - Breaking change: Update url dependency to v2 (#234)
- Breaking change: (async) Fix
Script::invoke_async
return type error (#233) - Add
GETRANGE
andSETRANGE
commands (#202) - Fix
SINTERSTORE
wrapper name, it's now correctlysinterstore
(#225) - Allow running
SharedConnection
with any other runtime (#229) - Reformatted as Edition 2018 code (#235)
BREAKING CHANGES
Use dyn
keyword to avoid deprecation warning (#223)
Rust nightly deprecated bare trait objects.
This PR adds the dyn
keyword to all trait objects in order to get rid of the warning.
This bumps the minimal supported Rust version to Rust 1.27.
Update url dependency to v2 (#234)
We updated the url
dependency to v2. We do expose this on our public API on the redis::parse_redis_url
function. If you depend on that, make sure to also upgrade your direct dependency.
(async) Fix Script::invoke_async return type error (#233)
Previously, invoking a script with a complex return type would cause the following error:
Response was of incompatible type: "Not a bulk response" (response was string data('"4b98bef92b171357ddc437b395c7c1a5145ca2bd"'))
This was because the Future returned when loading the script into the database returns the hash of the script, and thus the return type of String
would not match the intended return type.
This commit adds an enum to account for the different Future return types.
v0.11.0
This release includes all fixes & improvements from the two beta releases listed below.
This release contains breaking changes.
Fixes and improvements
- (async) Fix performance problem for SharedConnection (#222)
- (async) Don't block the executor from shutting down (#217)
- (async) Simplify implicit pipeline handling (#182)
- (async) Use
tokio_sync
's channels instead of futures (#195) - (async) Only allocate one oneshot per request (#194)
- Remove redundant BufReader when parsing (#197)
- Hide actual type returned from async parser (#193)
- Use more performant operations for line parsing (#198)
- Optimize the command encoding, see below for breaking changes (#165)
- Add support for geospatial commands (#130)
- (async) Add support for async Script invocation (#206)
BREAKING CHANGES
Renamed the async module to aio (#189)
async
is a reserved keyword in Rust 2018, so this avoids the need to write r#async
in it.
Old code:
use redis::async::SharedConnection;
New code:
use redis::aio::SharedConnection;
The trait ToRedisArgs
was changed (#165)
ToRedisArgs
has been changed to take take an instance of RedisWrite
instead of Vec<Vec<u8>>
. Use the write_arg
method instead of Vec::push
.
Minimum Rust version is now 1.26 (#165)
Upgrade your compiler.
impl Iterator
is used, requiring a more recent version of the Rust compiler.
iter
now takes self
by value (#165)
iter
now takes self
by value instead of cloning self
inside the method.
Old code:
let mut iter : redis::Iter<isize> = cmd.arg("my_set").cursor_arg(0).iter(&con).unwrap();
New code:
let mut iter : redis::Iter<isize> = cmd.arg("my_set").cursor_arg(0).clone().iter(&con).unwrap();
(The above line calls clone()
.)
A mutable connection object is now required (#148)
We removed the internal usage of RefCell
and Cell
and instead require a mutable reference, &mut ConnectionLike
,
on all command calls.
Old code:
let client = redis::Client::open("redis://127.0.0.1/")?;
let con = client.get_connection()?;
redis::cmd("SET").arg("my_key").arg(42).execute(&con);
New code:
let client = redis::Client::open("redis://127.0.0.1/")?;
let mut con = client.get_connection()?;
redis::cmd("SET").arg("my_key").arg(42).execute(&mut con);
Due to this, transaction
has changed. The callback now also receives a mutable reference to the used connection.
Old code:
let client = redis::Client::open("redis://127.0.0.1/").unwrap();
let con = client.get_connection().unwrap();
let key = "the_key";
let (new_val,) : (isize,) = redis::transaction(&con, &[key], |pipe| {
let old_val : isize = con.get(key)?;
pipe
.set(key, old_val + 1).ignore()
.get(key).query(&con)
})?;
New code:
let client = redis::Client::open("redis://127.0.0.1/").unwrap();
let mut con = client.get_connection().unwrap();
let key = "the_key";
let (new_val,) : (isize,) = redis::transaction(&mut con, &[key], |con, pipe| {
let old_val : isize = con.get(key)?;
pipe
.set(key, old_val + 1).ignore()
.get(key).query(&con)
})?;
Remove rustc-serialize
feature (#200)
We removed serialization to/from JSON. The underlying library is deprecated for a long time.
Old code in Cargo.toml
:
[dependencies.redis]
version = "0.9.1"
features = ["with-rustc-json"]
There's no replacement for the feature.
Use serde and handle the serialization/deserialization in your own code.
Remove with-unix-sockets
feature (#201)
We removed the Unix socket feature. It is now always enabled.
We also removed auto-detection.
Old code in Cargo.toml
:
[dependencies.redis]
version = "0.9.1"
features = ["with-unix-sockets"]
There's no replacement for the feature. Unix sockets will continue to work by default.
v0.10.0
v0.9.1
v0.9.0
Some time has passed since the last release.
This new release will bring less bugs, more commands, experimental async support and better performance.
Highlights:
- Implement flexible PubSub API (#136)
- Avoid allocating some redundant Vec's during encoding (#140)
- Add an async interface using futures-rs (#141)
- Allow the async connection to have multiple in flight requests (#143)
The async support is currently experimental.