kyotocabinet-0.1.3: Mid level bindings to Kyoto Cabinet

Safe HaskellNone
LanguageHaskell98

Database.KyotoCabinet.Operations

Contents

Synopsis

Logging options

data LoggingOptions Source

Constructors

LoggingOptions 

Fields

logFile :: LogFile

The file in which the log messages will be written

logKind :: [LogKind]
 
logPrefix :: String

The prefix of each log message

data LogFile Source

Constructors

File FilePath 
StdOut 
StdErr 

data LogKind Source

Constructors

Debug 
Info 
Warn 
Error 

defaultLoggingOptions :: LoggingOptions Source

Default logging options, outputting to stdout, all messages, and no prefix.

Opening mode

data ReadMode Source

Constructors

NoLock 
TryLock 
NoRepair 

Exceptions

Operations

Closing

close :: WithDB db => db -> IO () Source

Visitor

type VisitorFull Source

Arguments

 = ByteString

Key

-> ByteString

Value

-> IO (Either VisitorAction ByteString)

If a ByteString is returned, the value is changed.

type VisitorEmpty Source

Arguments

 = ByteString 
-> IO (Maybe ByteString)

If the ByteString is present, the value will be added.

data VisitorAction Source

Constructors

NoOperation

Don't do anything

Remove

Remove the record

accept :: WithDB db => db -> ByteString -> VisitorFull -> VisitorEmpty -> Writable -> IO () Source

Executes the VisitorFull on the existent records, and VisitorEmpty on the missing ones.

acceptBulk :: WithDB db => db -> [ByteString] -> VisitorFull -> VisitorEmpty -> Writable -> IO () Source

iterate :: WithDB db => db -> VisitorFull -> Writable -> IO () Source

scanPara :: WithDB db => db -> VisitorFull -> Int -> IO () Source

Setting

set :: WithDB db => db -> ByteString -> ByteString -> IO () Source

setBulk :: WithDB db => db -> [(ByteString, ByteString)] -> Bool -> IO Int64 Source

add :: WithDB db => db -> ByteString -> ByteString -> IO () Source

replace :: WithDB db => db -> ByteString -> ByteString -> IO () Source

append :: WithDB db => db -> ByteString -> ByteString -> IO () Source

Getting

get :: WithDB db => db -> ByteString -> IO (Maybe ByteString) Source

getBulk :: WithDB db => db -> [ByteString] -> Bool -> IO [(ByteString, ByteString)] Source

Remove

remove :: WithDB db => db -> ByteString -> IO () Source

removeBulk :: WithDB db => db -> [ByteString] -> Bool -> IO Int64 Source

seize :: WithDB db => db -> ByteString -> IO (Maybe ByteString) Source

clear :: WithDB db => db -> IO () Source

Copying/Backup

copy :: WithDB db => db -> FilePath -> IO () Source

dump :: WithDB db => db -> FilePath -> IO () Source

load :: WithDB db => db -> FilePath -> IO () Source

Info and statistics

count :: WithDB db => db -> IO Int64 Source

size :: WithDB db => db -> IO Int64 Source

path :: WithDB db => db -> IO String Source

status :: WithDB db => db -> IO String Source

Merging

data MergeMode Source

Constructors

Set 
Add 
Replace 
Append 

data GenericDB Source

Constructors

forall db . WithDB db => GenericDB db 

merge :: WithDB db => db -> [GenericDB] -> MergeMode -> IO () Source

Cursors

Creation

cursor :: WithDB db => db -> IO Cursor Source

Visitor

Setting

Getting

Removing

Moving