Skip to content

Commit

Permalink
feat: GETEX and GETDEL added
Browse files Browse the repository at this point in the history
  • Loading branch information
arpandaze committed May 27, 2022
1 parent 31d09ab commit 9402ab7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/commands.rs
Expand Up @@ -397,6 +397,16 @@ implement_commands! {
cmd("PTTL").arg(key)
}

/// Get the value of a key and set expiration
fn get_ex<K: ToRedisArgs>(key: K, seconds: usize) {
cmd("GETEX").arg(key).arg("EX").arg(seconds)
}

/// Get the value of a key and delete it
fn get_del<K: ToRedisArgs>(key: K) {
cmd("GETDEL").arg(key)
}

/// Rename a key.
fn rename<K: ToRedisArgs>(key: K, new_key: K) {
cmd("RENAME").arg(key).arg(new_key)
Expand Down

0 comments on commit 9402ab7

Please sign in to comment.