package redis-lwt

  1. Overview
  2. Docs

Module Redis_lwt.ClientSource

Sourcemodule IO = IO
Sourcemodule StringBound : sig ... end
Sourcemodule FloatBound : sig ... end

Types and exceptions

Sourcetype redirection = {
  1. slot : int;
  2. host : string;
  3. port : int;
}
Sourcetype reply = [
  1. | `Status of string
  2. | `Error of string
  3. | `Int of int
  4. | `Int64 of Int64.t
  5. | `Bulk of string option
  6. | `Multibulk of reply list
  7. | `Ask of redirection
  8. | `Moved of redirection
]
Sourceval string_of_reply : reply -> string

For debugging purpose.

  • since 0.4
Sourcetype connection_spec = {
  1. host : string;
  2. port : int;
}

Server connection info

Sourceval string_of_connection_spec : connection_spec -> string

Print the spec

  • since 0.8
Sourceval pp_connection_spec : Format.formatter -> connection_spec -> unit

Print the spec

  • since 0.8
Sourceval connection_spec : ?port:int -> string -> connection_spec

Create a connection spec with the given host.

  • parameter port

    port to connect to (default 6379)

  • since 0.5
Sourceval connection_spec_unix_socket : string -> connection_spec

Create a connection spec to use the given Unix socket.

  • since 0.7
Sourcemodule SlotMap : Map.S with type key = int
Sourcetype cluster_connections = private {
  1. mutable connections_spec : connection_spec SlotMap.t;
  2. mutable connections : connection ConnectionSpecMap.t;
}
Sourceand connection = private {
  1. fd : IO.fd;
  2. in_ch : IO.in_channel;
  3. out_ch : IO.out_channel;
  4. stream : reply list IO.stream;
  5. cluster : cluster_connections;
}
Sourceexception Redis_error of string

Error responses from server

Sourceexception Unexpected of reply

Protocol errors

Sourceexception Unrecognized of string * string
Sourcetype bit_operation =
  1. | AND
  2. | OR
  3. | XOR
  4. | NOT

Possible BITOP operations

Connection handling

Sourceval disconnect : connection -> unit IO.t
Sourceval with_connection : connection_spec -> (connection -> 'a IO.t) -> 'a IO.t
Sourceval stream : connection -> reply list IO.stream

Connection commands

Sourceval auth : connection -> string -> unit IO.t

Authenticate to server.

Sourceval send_custom_request : connection -> string list -> reply IO.t

Sends a custom request to the Redis server. Example: send_request connection ["set"; "foo"; "bar"]

  • since 0.6
Sourceval send_pipelined_custom_requests : connection -> string list list -> reply list IO.t

Send a list of custom requests in a pipelined fashion (all are written, then all replies are read)

  • since 0.8
Sourceval auth_acl : connection -> string -> string -> unit IO.t

Authenticate to server with username and password.

Sourceval echo : connection -> string -> string option IO.t

Echo given string.

Sourceval ping : connection -> bool IO.t

Ping connection; returns true if ping was successfull.

Sourceval quit : connection -> unit IO.t

Close connection.

Sourceval select : connection -> int -> unit IO.t

Switch to a different db; raises Error if index is invalid.

Sourceval sentinel_masters : connection -> (string * string) list list IO.t

SENTINEL commands

Sourceval sentinel_get_master_addr_by_name : connection -> string -> (string * string) option IO.t

Keys commands

Sourceval del : connection -> string list -> int IO.t

Delete a key; returns the number of keys removed.

Sourceval exists : connection -> string -> bool IO.t

Determine if a key exists.

Sourceval expire : connection -> string -> int -> bool IO.t

Set a key's time to live in seconds; returns true if timeout was set, false otherwise.

Sourceval pexpire : connection -> string -> int -> bool IO.t

Set a key's time to live in milliseconds; returns true if timeout was set, false otherwise.

Sourceval expireat : connection -> string -> float -> bool IO.t

Set the expiration for a key as a UNIX timestamp, the time is truncated to the nearest second; returns true if timeout was set, false otherwise.

Sourceval pexpireat : connection -> string -> int -> bool IO.t

Set the expiration for a key as a UNIX timestamp in milliseconds; returns true if timeout was set, false otherwise.

Sourceval keys : connection -> string -> string list IO.t

Find all keys matching the given pattern.

Sourceval scan : ?pattern:string -> ?count:int -> connection -> int -> (int * string list) IO.t

Incrementally iterate the keys space; see tests for usage example.

Sourceval move : connection -> string -> int -> bool IO.t

Move key to a different db; returns true if key was moved, false otherwise.

Sourceval persist : connection -> string -> bool IO.t

Remove timeout on key; returns true if timeout was removed, false otherwise.

Sourceval randomkey : connection -> string option IO.t

Return a random key from the keyspace; returns None if db is empty.

Sourceval rename : connection -> string -> string -> unit IO.t

Rename a key; raises Error if key doesn't exist.

Sourceval renamenx : connection -> string -> string -> bool IO.t

Rename a key, only if the new key does not exist; returns true if key was renamed, false if newkey already exists.

Sourceval sort : connection -> ?by:string -> ?limit:(int * int) -> ?get:'a list -> ?order:[< `Asc | `Desc ] -> ?alpha:bool -> string -> string list IO.t

Sort elements in a list, set or sorted set; return sorted list of items.

Sourceval sort_and_store : connection -> ?by:string -> ?limit:(int * int) -> ?get:'a list -> ?order:[< `Asc | `Desc ] -> ?alpha:bool -> string -> string -> int IO.t

Sort and store elements in a list, set or sorted set; returns length of sorted items list which was stored.

Sourceval ttl : connection -> string -> int option IO.t

Time to live for a key in seconds; returns None if key doesn't exist or doesn't have a timeout.

Sourceval pttl : connection -> string -> int option IO.t

Time to live for a key in milliseconds; returns None if key doesn't exist or doesn't have a timeout.

Sourceval type_of : connection -> string -> [> `Hash | `List | `None | `String | `Zset ] IO.t

Determine the type stored as key.

Sourceval dump : connection -> string -> string option IO.t

Return a serialized version of the value stored at the specified key; returns None if key doesn't exist.

Sourceval restore : connection -> string -> int -> string -> unit IO.t

Create a key with serialized value (obtained via DUMP).

Sourceval migrate : connection -> ?copy:bool -> ?replace:bool -> string -> int -> string -> int -> int -> unit IO.t

Atomically transfer a key from a source Redis instance to a destination Redis instance.

Sourceval object_refcount : connection -> string -> int option IO.t

Inspect the internals of Redis objects; returns the number of references of the value associated with the specified key.

Sourceval object_encoding : connection -> string -> string option IO.t

Inspect the internals of Redis objects; returns the kind of internal representation used in order to store the value associated with a key.

Sourceval object_idletime : connection -> string -> int option IO.t

Inspect the internals of Redis objects; returns the number of seconds since the object stored at the specified key is idle.

String commands

Sourceval append : connection -> string -> string -> int IO.t

Append a value to a key; returns length of string after append.

Sourceval setbit : connection -> string -> int -> int -> int IO.t

Sets or clears the bit at offset in the string value stored at key.

Sourceval getbit : connection -> string -> int -> int IO.t

Returns the bit value at offset in the string value stored at key.

Sourceval bitop : connection -> bit_operation -> string -> string list -> int IO.t

Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key. See bit_operation type for available operations.

Sourceval bitcount : ?first:int -> ?last:int -> connection -> string -> int IO.t

Count the number of set bits (population counting) in a string.

Sourceval bitpos : ?first:int -> ?last:int -> connection -> string -> int -> int IO.t

Return the position of the first bit set to 1 or 0 in a string.

Sourceval decr : connection -> string -> int IO.t

Decrements the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation.

Sourceval decrby : connection -> string -> int -> int IO.t

Decrements the number stored at key by decrement. If the key does not exist, it is set to 0 before performing the operation.

Sourceval get : connection -> string -> string option IO.t

Get the value of key.

Sourceval getrange : connection -> string -> int -> int -> string option IO.t

Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive).

Sourceval getset : connection -> string -> string -> string option IO.t

Atomically sets key to value and returns the old value stored at key. Returns None when key exists but does not hold a string value.

Sourceval incr : connection -> string -> int IO.t

Increments the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation.

Sourceval incrby : connection -> string -> int -> int IO.t

Increments the number stored at key by increment. If the key does not exist, it is set to 0 before performing the operation.

Sourceval incrbyfloat : connection -> string -> float -> float IO.t

Increment the string representing a floating point number stored at key by the specified increment. If the key does not exist, it is set to 0 before performing the operation.

Sourceval mget : connection -> string list -> string option list IO.t

Returns the values of all specified keys.

Sourceval mset : connection -> (string * string) list -> unit IO.t

Sets the given keys to their respective values.

Sourceval msetnx : connection -> (string * string) list -> bool IO.t

Sets the given keys to their respective values. MSETNX will not perform any operation at all even if just a single key already exists.

Sourceval set : connection -> ?ex:int -> ?px:int -> ?nx:bool -> ?xx:bool -> string -> string -> bool IO.t

Set key to hold the string value.

Sourceval setex : connection -> string -> int -> string -> unit IO.t

Set key to hold the string value and set key to timeout after a given number of seconds.

Sourceval psetex : connection -> string -> int -> string -> unit IO.t

PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.

Sourceval setnx : connection -> string -> string -> bool IO.t

Set key to hold string value if key does not exist.

Sourceval setrange : connection -> string -> int -> string -> int IO.t

Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.

Sourceval strlen : connection -> string -> int IO.t

Returns the length of the string value stored at key. An error is returned when key holds a non-string value.

Hash commands

Sourceval hdel : connection -> string -> string -> bool IO.t

Removes the specified fields from the hash stored at key. Specified fields that do not exist within this hash are ignored.

Sourceval hexists : connection -> string -> string -> bool IO.t

Returns if field is an existing field in the hash stored at key.

Sourceval hget : connection -> string -> string -> string option IO.t

Returns the value associated with field in the hash stored at key.

Sourceval hgetall : connection -> string -> (string * string) list IO.t

Returns all fields and values of the hash stored at key.

Sourceval hincrby : connection -> string -> string -> int -> int IO.t

Increments the number stored at field in the hash stored at key by increment.

Sourceval hincrbyfloat : connection -> string -> string -> float -> float IO.t

Increments the number stored at field in the hash stored at key by increment.

Sourceval hkeys : connection -> string -> string list IO.t

Returns all field names in the hash stored at key.

Sourceval hlen : connection -> string -> int IO.t

Returns the number of fields contained in the hash stored at key.

Sourceval hmget : connection -> string -> string list -> string option list IO.t

Returns the values associated with the specified fields in the hash stored at key.

Sourceval hmset : connection -> string -> (string * string) list -> unit IO.t

Sets the specified fields to their respective values in the hash stored at key.

Sourceval hset : connection -> string -> string -> string -> bool IO.t

Sets field in the hash stored at key to value.

Sourceval hsetnx : connection -> string -> string -> string -> bool IO.t

Sets field in the hash stored at key to value, only if field does not yet exist.

Sourceval hstrlen : connection -> string -> string -> int IO.t

Get the length of the value of a hash field

Sourceval hscan : ?pattern:string -> ?count:int -> connection -> string -> int -> (int * (string * string) list) IO.t

Incrementally iterate hash fields and associated values

Sourceval hvals : connection -> string -> string list IO.t

Returns all values in the hash stored at key.

List commands

Sourceval blpop : connection -> string list -> int -> (string * string) option IO.t

Remove and get the first element in a list, or block until one is available

Sourceval brpop : connection -> string list -> int -> (string * string) option IO.t

Remove and get the last element in a list, or block until one is available

Sourceval brpoplpush : connection -> string -> string -> int -> string option IO.t

Pop a value from a list, push it to another list and return it; or block until one is available

Sourceval lindex : connection -> string -> int -> string option IO.t

Get an element from a list by its index

Sourceval linsert : connection -> string -> [< `After | `Before ] -> string -> string -> int option IO.t

Insert an element before or after another element in a list

Sourceval llen : connection -> string -> int IO.t

Get the length of a list

Sourceval lpop : connection -> string -> string option IO.t

Remove and get the first element in a list

Sourceval lpush : connection -> string -> string list -> int IO.t

Prepend one or multiple values to a list

Sourceval lpushx : connection -> string -> string list -> int IO.t

Prepend a value to a list, only if the list exists

Sourceval lrange : connection -> string -> int -> int -> string list IO.t

Get a range of elements from a list

Sourceval lrem : connection -> string -> int -> string -> int IO.t

Remove elements from a list

Sourceval lset : connection -> string -> int -> string -> unit IO.t

Set the value of an element in a list by its index

Sourceval ltrim : connection -> string -> int -> int -> unit IO.t

Trim a list to the specified range

Sourceval rpop : connection -> string -> string option IO.t

Remove and get the last element in a list

Sourceval rpoplpush : connection -> string -> string -> string option IO.t

Remove the last element in a list, prepend it to another list and return it

Sourceval rpush : connection -> string -> string list -> int IO.t

Append one or multiple values to a list

Sourceval rpushx : connection -> string -> string list -> int IO.t

Append a value to a list, only if the list exists

Sourceval lmove : connection -> string -> string -> [ `Left | `Right ] -> [ `Left | `Right ] -> string option IO.t

lmove from into sidefrom sideinto moves an element from from into into, picking which side to pop/push based on the last arguments, and returns the element.

  • since 0.6

since redis 6.2

Sourceval blmove : connection -> string -> string -> [ `Left | `Right ] -> [ `Left | `Right ] -> timeout:int -> string option IO.t

same as lmove but blocks for up to timeout seconds.

HyperLogLog commands

Sourceval pfadd : connection -> string -> string list -> bool IO.t

Adds values to the HyperLogLog data structure.

Sourceval pfcount : connection -> string list -> int IO.t

Returns the approximated cardinality of the union of the HyperLogLogs passed.

Sourceval pfmerge : connection -> string list -> unit IO.t

Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed Sets of the source HyperLogLog structures.

Set commands

Sourceval sadd : connection -> string -> string -> bool IO.t

Returns true if member was added, false otherwise.

Sourceval scard : connection -> string -> int IO.t
Sourceval sdiff : connection -> string list -> string list IO.t

Difference between first and all successive sets.

Sourceval sdiffstore : connection -> string -> string list -> int IO.t

like sdiff, but store result in destination. returns size of result.

Sourceval sinter : connection -> string list -> string list IO.t
Sourceval sinterstore : connection -> string -> string list -> int IO.t

Like SINTER, but store result in destination. Returns size of result.

Sourceval sismember : connection -> string -> string -> bool IO.t
Sourceval smembers : connection -> string -> string list IO.t
Sourceval smove : connection -> string -> string -> string -> bool IO.t

Returns true if an element was moved, false otherwise.

Sourceval spop : connection -> string -> string option IO.t

Remove random element from set.

Sourceval srandmember : connection -> string -> string option IO.t

Like SPOP, but doesn't remove chosen element.

Sourceval srem : connection -> string -> string -> bool IO.t

Returns true if element was removed.

Sourceval sunion : connection -> string list -> string list IO.t
Sourceval sunionstore : connection -> string -> string list -> int IO.t

Like SUNION, but store result in destination. Returns size of result.

Pub/sub commands

Sourceval publish : connection -> string -> string -> int IO.t

Post a message to a channel. Returns number of clients that received the message.

Sourceval pubsub_channels : connection -> string option -> reply list IO.t

Lists the currently active channels. If no pattern is specified, all channels are listed.

Sourceval pubsub_numsub : connection -> string list -> reply list IO.t

Returns the number of subscribers (not counting clients subscribed to patterns) for the specified channels.

Sourceval subscribe : connection -> string list -> unit IO.t

Subscribes the client to the specified channels.

From now on only pubsub related commands are accepted on the connection. Use stream to read the stream the notifications (possibly-concurrently). Each notification in the form of ["message"; "<channel name>"; "<message>"] for subscribed messages, or ["subscribe"; <list of channel>] or ["unsubscribe"; <list of channels] . Use reset to exit the subscription state and issue other types of commands. See https://redis.io/docs/latest/develop/interact/pubsub/ for more details.

Sourceval unsubscribe : connection -> string list -> unit IO.t

Unsubscribes the client from the given channels, or from all of them if an empty list is given

Sourceval psubscribe : connection -> string list -> unit IO.t

Subscribes the client to the given patterns. See subscribe for more details.

Sourceval punsubscribe : connection -> string list -> unit IO.t

Unsubscribes the client from the given patterns.

Sorted set commands

Sourceval zadd : connection -> ?x:[< `NX | `XX ] -> ?ch:bool -> string -> (float * string) list -> int IO.t

Add one or more members to a sorted set, or update its score if it already exists.

Sourceval zrange : connection -> ?withscores:bool -> string -> int -> int -> reply list IO.t

Return a range of members in a sorted set, by index.

Sourceval zrevrange : connection -> ?withscores:bool -> string -> int -> int -> reply list IO.t

Return a reversed range of members in a sorted set, by index.

Sourceval zrangebyscore : connection -> ?withscores:bool -> ?limit:(int * int) -> string -> FloatBound.t -> FloatBound.t -> reply list IO.t

Return a range of members in a sorted set, by score.

Sourceval zrangebylex : connection -> ?limit:(int * int) -> string -> StringBound.t -> StringBound.t -> reply list IO.t

Return a range of members in a sorted set, by lexicographical range.

Sourceval zrevrangebyscore : connection -> ?withscores:bool -> ?limit:(int * int) -> string -> FloatBound.t -> FloatBound.t -> reply list IO.t

Return a range of members in a sorted set, by score.

Sourceval zrevrangebylex : connection -> ?limit:(int * int) -> string -> StringBound.t -> StringBound.t -> reply list IO.t

Return a range of members in a sorted set, by lexicographical range.

Sourceval zrem : connection -> string -> string list -> int IO.t

Remove one or more members from a sorted set.

Sourceval zremrangebylex : connection -> string -> StringBound.t -> StringBound.t -> int IO.t

Remove all members in a sorted set between the given lexicographical range.

Sourceval zremrangebyscore : connection -> string -> FloatBound.t -> FloatBound.t -> int IO.t

Remove all members in a sorted set between the given score range.

Sourceval zremrangebyrank : connection -> string -> int -> int -> int IO.t

Remove all members in a sorted set between the given rank range.

Sourceval zcard : connection -> string -> int IO.t

Returns the sorted set cardinality (number of elements) of the sorted set stored at key.

Sourceval zincrby : connection -> string -> float -> string -> float IO.t

Increment the score of a member in the sorted set

Sourceval zscore : connection -> string -> string -> float option IO.t

Returns the score of a member in the sorted set.

Sourceval zcount : connection -> string -> FloatBound.t -> FloatBound.t -> int IO.t

Returns the number of elements in the sorted set at key with a score between min and max.

Sourceval zlexcount : connection -> string -> StringBound.t -> StringBound.t -> int IO.t

Returns the number of members in a sorted set between a given lexicographical range.

Sourceval zrank : connection -> string -> string -> int option IO.t

Returns the rank of member in the sorted set stored at key.

Sourceval zrevrank : connection -> string -> string -> int option IO.t

Returns the reversed rank of member in the sorted set stored at key.

Sourceval zpopmin : connection -> string -> int -> (string * float) list IO.t

Removes and returns one or more members with the lowest scores in a sorted set.

Sourceval zpopmax : connection -> string -> int -> (string * float) list IO.t

Remove and return one or more members with the highest scores in a sorted set.

Sourceval bzpopmin : connection -> string list -> float -> (string * string * float) option IO.t

Remove and return the member with the lowest score in a sorted set, or block until one is available.

Sourceval bzpopmax : connection -> string list -> float -> (string * string * float) option IO.t

Remove and return the member with the highest score in a sorted set, or block until one is available.

Stream commands

For redis >= 5. We only support a subset of the commands for now.

Sourceval xadd : connection -> string -> ?maxlen:[ `Exact of int | `Approximate of int ] -> ?id:string -> (string * string) list -> string IO.t

Add a stream event, as a list of key-value pairs, to the given stream.

  • returns

    the ID of the new event

  • parameter maxlen

    can be used to trim the stream.

  • parameter id

    specify a custom ID. Most of the of time you don't want to set this.

@see the official doc

  • since 0.5
Sourceval xdel : connection -> string -> string list -> int IO.t

Delete specific stream events. Should be rarely useful.

  • returns

    the number of deleted events.

@see the official doc

  • since 0.5
Sourceval xlen : connection -> string -> int IO.t

Length of a stream. @see https://redis.io/commands/xlen .

  • since 0.5
Sourceval xtrim : connection -> string -> maxlen:[ `Exact of int | `Approximate of int ] -> unit -> int IO.t

Trim stream to the given maximum length.

  • parameter maxlen

    the maximum number of entries to preserve, prioritizing the most recent ones. `Approximate n is faster, and should be preferred.

  • returns

    number of deleted entries

@see the official doc

  • since 0.5
Sourcetype stream_event = string * (string * string) list

A stream event as returned by Redis. It is composed of a stream ID (timestamp + counter), and a list of key/value pairs.

  • since 0.5
Sourceval xrange : connection -> string -> start:StringBound.t -> end_:StringBound.t -> ?count:int -> unit -> stream_event list IO.t

xrange connection stream ~start ~end_ () returns a range of events in the stream.

  • parameter start

    beginning of the range. It can be one of:

  • StringBound.NegInfinity ("-" in the doc) to indicate the earliest possible time
  • StringBound.Inclusive "timestamp" or StringBound.Inclusive "timestamp-number" for a left-inclusive bound
  • StringBound.Exclusive "timestamp" or StringBound.Exclusive "timestamp-number" for a left-exclusive bound ("(" in the doc) only since Redis 6.2
  • parameter end_

    same as start but for the right bound

  • parameter count

    maximum number of events returned

  • returns

    a lits of events (at most count if specified). Each event is a pair (id, pairs) where id is the unique ID of the event, of the form "<timestamp>-<counter>", and pairs is a list of key-value pairs associated with the event.

@see the official doc

  • since 0.5
Sourceval xrevrange : connection -> string -> start:StringBound.t -> end_:StringBound.t -> ?count:int -> unit -> stream_event list IO.t

Like xrange but in reverse order. @see the official doc

  • since 0.5
Sourceval xread : connection -> ?count:int -> ?block_ms:int -> (string * [ `Last | `After of string ]) list -> (string * stream_event list) list IO.t

xread connection pairs reads data from the multiple streams specified in pairs.

Each item of pairs is a pair ("stream-name", <after>) where <after> is either:

  • `Last ("$" in the doc) to get events coming after the last current event (so, new events);
  • or `After i to get events coming after the given ID i, excluding i itself.
  • returns

    a list of ("stream-name", <events>). Each pair contains the name of a stream (that was among the input pairs), along with events of that stream coming after the corresponding position.

  • parameter count

    max number of events returned per stream

  • parameter block_ms

    if provided, xread blocks at most block_ms milliseconds for new events. Otherwise xread is synchronous and returns immediately.

@see the official doc

  • since 0.5

Transaction commands

Sourceval multi : connection -> unit IO.t

Marks the start of a transaction block. Subsequent commands will be queued for atomic execution using EXEC.

Sourceval exec : connection -> reply list IO.t

Executes all previously queued commands in a transaction and restores the connection state to normal.

Sourceval discard : connection -> unit IO.t

Flushes all previously queued commands in a transaction and restores the connection state to normal.

Sourceval watch : connection -> string list -> unit IO.t

Marks the given keys to be watched for conditional execution of a transaction.

Sourceval unwatch : connection -> unit IO.t

Flushes all the previously watched keys for a transaction.

Sourceval queue : (unit -> 'a IO.t) -> unit IO.t

Within a transaction (see multi, exec, and discard), commands will not return their normal value. It is necessary to wrap each of them in their individual Client.queue (fun () -> the_command) to avoid getting an exception Unexpected (Status "QUEUED").

Scripting commands

Sourceval script_load : connection -> string -> string IO.t

Load the specified Lua script into the script cache. Returns the SHA1 digest of the script for use with EVALSHA.

Sourceval eval : connection -> string -> string list -> string list -> reply IO.t

Evaluates a script using the built-in Lua interpreter.

Sourceval evalsha : connection -> string -> string list -> string list -> reply IO.t

Evaluates a script cached on the server side by its SHA1 digest.

Server

Sourceval bgrewriteaof : connection -> unit IO.t
Sourceval bgsave : connection -> unit IO.t
Sourceval config_resetstat : connection -> unit IO.t
Sourceval dbsize : connection -> int IO.t
Sourceval flushall : connection -> unit IO.t

clear all databases

Sourceval flushdb : connection -> unit IO.t

clear current database

Sourceval info : connection -> (string * string) list IO.t
Sourceval lastsave : connection -> float IO.t

last successful save as Unix timestamp

Sourceval role : connection -> reply list IO.t

role in context of replication

Sourceval save : connection -> unit IO.t

synchronous save

Sourceval shutdown : connection -> unit IO.t

save and shutdown server

Sourcemodule MassInsert : sig ... end

Batch commands for mass insertion

OCaml

Innovation. Community. Security.