haskell-tyrant-0.4: Haskell implementation of the Tokyo Tyrant binary protocol

StabilityExperimental
Maintainertravis.brady@gmail.com

Database.TokyoTyrant

Description

A pure Haskell interface to the Tokyo Tyrant database server

Synopsis

Documentation

closeConnection :: TokyoTyrantHandle -> IO ()Source

Close connection to ttserver

putDouble :: TokyoTyrantHandle -> ByteString -> Double -> IO (Either [Char] Double)Source

Store a record where the value is a double

getInt :: TokyoTyrantHandle -> ByteString -> IO (Either [Char] Int)Source

Retrieve a record with an Int value

putInt :: TokyoTyrantHandle -> ByteString -> Int -> IO (Either [Char] Int)Source

Store a record with an Int value

putKeep :: TokyoTyrantHandle -> ByteString -> ByteString -> IO (Either String String)Source

Store a new record If key already exists nothing is done

putCat :: TokyoTyrantHandle -> ByteString -> ByteString -> IO (Either String String)Source

Concatenate a value at the end of the existing record

vsiz :: TokyoTyrantHandle -> ByteString -> IO (Either [Char] Int)Source

Get the size of the value of a record

mget :: TokyoTyrantHandle -> [ByteString] -> IO (Either [Char] [(ByteString, ByteString)])Source

Fetch keys and values for multiple records

sync :: TokyoTyrantHandle -> IO (Either String String)Source

Synchronize updated contents with the database file

copy :: TokyoTyrantHandle -> ByteString -> IO (Either String String)Source

Copy the database file to the specified path

addInt :: Integral a => TokyoTyrantHandle -> ByteString -> a -> IO (Either [Char] Int)Source

Add an integer to a record

size :: TokyoTyrantHandle -> IO (Either [Char] Int)Source

Get the size of the database

rnum :: TokyoTyrantHandle -> IO (Either [Char] Int)Source

Get the number of records

stat :: TokyoTyrantHandle -> IO (Either [Char] [[ByteString]])Source

Get the stats string

restore :: Integral a => TokyoTyrantHandle -> ByteString -> a -> IO (Either String String)Source

Restore the database with update log

putshlSource

Arguments

:: Integral a 
=> TokyoTyrantHandle

Connection

-> ByteString

key

-> ByteString

value

-> a

width

-> IO (Either String String) 

concatenate a value at the end of the existing record and shift it to the lef

putnr :: TokyoTyrantHandle -> ByteString -> ByteString -> IO ()Source

store a record into a remote database object without response from the server

iterinit :: TokyoTyrantHandle -> IO (Either String String)Source

initialize the iterator of a remote database object

iternext :: TokyoTyrantHandle -> IO (Either [Char] ByteString)Source

get the next key of the iterator of a remote database object

fwmkeys :: Integral a => TokyoTyrantHandle -> ByteString -> a -> IO (Either [Char] [ByteString])Source

get forward matching keys in a remote database object

extSource

Arguments

:: TokyoTyrantHandle

Connection to Tokyo Tyrant

-> ByteString

the lua function to be called

-> ByteString

specifies the key

-> ByteString

specified the value

-> [TyrantOption]

locking and update log options

-> IO (Either [Char] ByteString) 

Call a function of the script language extension

miscSource

Arguments

:: TokyoTyrantHandle

Connection to Tokyo Tyrant

-> ByteString

funcname

-> [ByteString]

args

-> [TyrantOption]

options

-> IO (Either [Char] [ByteString]) 

Call a versatile function for miscellaneous operations funcname can be getlist, putlist and outlist getlist takes a list of keys and returns a list of values putlist takes a list of keys and values one after the other and returns [] outlist takes a list of keys and removes those records