class

Redis::DatabaseManager

Inherits Reference < Object

Constants

DEFAULT_DB_COUNT = 16

Constructors

new(default_count = DEFAULT_DB_COUNT)
Source

Instance methods

copy_database(source_id : DatabaseId, dest_id : DatabaseId, replace : Bool = false) : Tuple(Bool, String | Nil)

Copy all data from source to destination database

Source
copy_keys(source_id : DatabaseId, dest_id : DatabaseId, pattern : String) : Tuple(Int64, String | Nil)

Copy keys matching pattern from source to destination

Source
create_database(id : DatabaseId, if_not_exists : Bool = false) : Tuple(Bool, String | Nil)

Create a new named or numeric database

Source
database_count

Get total database count

Source
database_exists?(id : DatabaseId) : Bool

Check if database exists

Source
database_info(id : DatabaseId) : DatabaseInfo | Nil

Get info for a specific database

Source
drop_database(id : DatabaseId, if_exists : Bool = false) : Tuple(Bool, String | Nil)

Drop/delete a database

Source
flush_all

Flush all databases

Source
freeze_database(id : DatabaseId) : Tuple(Bool, String | Nil)

Freeze a database (make read-only)

Source
frozen?(id : DatabaseId) : Bool

Check if database is frozen

Source
get(id : DatabaseId) : Database | Nil

Get a database by ID (returns nil if not exists)

Source
get_or_create(id : Int32) : Database

Get a database, creating if it doesn't exist (for numeric IDs only)

Source
list_databases(pattern : String | Nil = nil) : Array(DatabaseInfo)

List all databases with their info

Source
reset_database(id : DatabaseId) : Tuple(Bool, String | Nil)

Reset a database (clear all data but keep it)

Source
unfreeze_database(id : DatabaseId) : Tuple(Bool, String | Nil)

Unfreeze a database (make writable)

Source