class

Redis::Database

Inherits Reference < Object

Constructors

Instance methods

append(key : Bytes, value : Bytes) : Int64
Source
cleanup_empty(key : Bytes) : Nil
Source
clear
Source
decr(key : Bytes) : Int64
Source
decrby(key : Bytes, decrement : Int64) : Int64
Source
del(key : Bytes) : Bool
Source
exists?(key : Bytes) : Bool
Source
expire(key : Bytes, ttl_ms : Int64) : Bool

Set TTL on existing key (returns false if key doesn't exist)

Source
get(key : Bytes) : Bytes | Nil
Source
get_entry(key : Bytes) : Entry | Nil
Source
get_hash(key : Bytes) : HashType | Nil
Source
get_key_version(key : Bytes) : Int64

Get the current version of a key (for WATCH)

Source
get_list(key : Bytes) : ListType | Nil
Source
get_or_create_hash(key : Bytes) : HashType
Source
get_or_create_list(key : Bytes) : ListType
Source
get_or_create_set(key : Bytes) : SetType
Source
get_or_create_sorted_set(key : Bytes) : SortedSetType
Source
get_set(key : Bytes) : SetType | Nil
Source
get_sorted_set(key : Bytes) : SortedSetType | Nil
Source
getrange(key : Bytes, start_idx : Int64, end_idx : Int64) : Bytes
Source
incr(key : Bytes) : Int64
Source
incrby(key : Bytes, increment : Int64) : Int64
Source
incrbyfloat(key : Bytes, increment : Float64) : Float64
Source
keys
Source
mark_key_modified(key : Bytes) : Nil

Mark a key as modified (for WATCH tracking) Call this after any write operation on a key

Source
persist(key : Bytes) : Bool

Remove TTL from key (make persistent)

Source
pttl(key : Bytes) : Int64

Get remaining TTL in milliseconds (-2 if no key, -1 if no TTL)

Source
rename(old_key : Bytes, new_key : Bytes) : Tuple(Bool, String | Nil)

Rename key (overwrites destination)

Source
renamenx(old_key : Bytes, new_key : Bytes) : Tuple(Int64, String | Nil)

Rename only if new key doesn't exist

Source
scan(cursor : Int64, pattern : String | Nil = nil, count : Int64 = 10) : Tuple(Int64, Array(Bytes))

Cursor-based key iteration

Source
set(key : Bytes, value : Bytes, ttl : Int64 | Nil = nil) : Nil
Source
setrange(key : Bytes, offset : Int64, value : Bytes) : Int64
Source
size
Source
strlen(key : Bytes) : Int64
Source
ttl(key : Bytes) : Int64

Get remaining TTL in seconds

Source
type_of(key : Bytes) : String
Source