kyotocabinet-0.1.4: Mid level bindings to Kyoto Cabinet

Safe HaskellNone
LanguageHaskell98

Database.KyotoCabinet.Operations

Contents

Synopsis

Logging options

data LoggingOptions Source #

Constructors

LoggingOptions 

Fields

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 Mode Source #

Constructors

Reader [ReadMode] 
Writer [WriteMode] [ReadMode] 

data ReadMode Source #

Constructors

NoLock 
TryLock 
NoRepair 

Exceptions

Type class

class WithDB db where Source #

A thing that has database

Minimal complete definition

getDB

Methods

getDB :: db -> DB Source #

Access database

data DB Source #

Polymorphic database

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.

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

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

Scan each record in parallel

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

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 #

Retrieve the value of a record and remove it atomically

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 #

Get the path of the database file

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

Merging

data MergeMode Source #

Constructors

Set 
Add 
Replace 
Append 

data GenericDB Source #

Constructors

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