monarch-0.1.0.0: Monadic interface for TokyoTyrant.

Safe HaskellNone

Database.Monarch

Contents

Description

This module makes tokyotyrant-haskell monadic.

Synopsis

Basic Types

TokyoTyrant DB action monad and its runner

runMonarchSource

Arguments

:: MonadIO m 
=> Host

host

-> Port

port

-> Monarch a

action

-> m (Either String a) 

Run Monarch with TokyoTyrant at target host and port.

Fetchstore single keyvalue

getSource

Arguments

:: Key

key

-> Monarch (Maybe Value) 

Get a value. If not found, return Nothing.

putSource

Arguments

:: Key

key

-> Value

value

-> Monarch () 

Destructive store a value.

putKeepSource

Arguments

:: Key

key

-> Value

value

-> Monarch () 

Non-Destructive store a value.

Fetchstore multiple keyvalue

mgetSource

Arguments

:: [Key]

keys to get

-> Monarch [(Key, Value)] 

Get values.

mputSource

Arguments

:: [(Key, Value)]

key/value pairs to put

-> Monarch () 

Put values.

Delete key/value

deleteSource

Arguments

:: Key

key to delete

-> Monarch () 

Delete a value.

vanish :: Monarch ()Source

Delete all value.

Search key prefix

fwmkeysSource

Arguments

:: ByteString

key prefix

-> Maybe Int

max # of returned keys; Nothing means no limit

-> Monarch [Key] 

Search keys by prefix.