Function ntex_redis::cmd::Select

source ·
pub fn Select(db: u32) -> SelectCommand
Expand description

SELECT redis command

Select the Redis logical database having the specified zero-based numeric index.

use ntex_redis::{cmd, RedisConnector};

#[ntex::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let redis = RedisConnector::new("127.0.0.1:6379").connect().await?;

    // select db for current connection
    let success = redis.exec(cmd::Select(1)).await?;

    assert!(success);

    Ok(())
}