redis-async-rs icon indicating copy to clipboard operation
redis-async-rs copied to clipboard

this crate may need some docs update like use build with username and password

Open bruceunx opened this issue 10 months ago • 0 comments

When I use this crate in my project, I look for the solution to add auth to the paired_connect in the docs and issues, It failed, so I check the source code, and find the ConnectionBuilder in client module, which support username and password, and it works fine. here is the solution example for anyone with the similar need:

    let mut builder = redis_async::client::ConnectionBuilder::new(
        &redis_settings.redis_host,
        redis_settings.redis_port,
    )
    .unwrap();
    builder.password(redis_settings.redis_password);

    let redis_client = builder.paired_connect().await.ok();

better to add to to docs or in the example :)

bruceunx avatar Dec 04 '24 03:12 bruceunx