Portability | portable |
---|---|
Stability | experimental |
Maintainer | Bryan O'Sullivan <bos@mailrank.com> |
This module allows storage and retrieval of data using the
IsContent
typeclass. This provides access to more of Riak's
storage features than JSON, e.g. links.
The functions in this module do not perform any conflict resolution.
- class IsContent c where
- parseContent :: Content -> Parser c
- toContent :: c -> Content
- fromContent :: IsContent c => Content -> Maybe c
- get :: IsContent c => Connection -> Bucket -> Key -> R -> IO (Maybe ([c], VClock))
- getMany :: IsContent c => Connection -> Bucket -> [Key] -> R -> IO [Maybe ([c], VClock)]
- put :: IsContent c => Connection -> Bucket -> Key -> Maybe VClock -> c -> W -> DW -> IO ([c], VClock)
- put_ :: IsContent c => Connection -> Bucket -> Key -> Maybe VClock -> c -> W -> DW -> IO ()
- putMany :: IsContent c => Connection -> Bucket -> [(Key, Maybe VClock, c)] -> W -> DW -> IO [([c], VClock)]
- putMany_ :: IsContent c => Connection -> Bucket -> [(Key, Maybe VClock, c)] -> W -> DW -> IO ()
Documentation
fromContent :: IsContent c => Content -> Maybe cSource
get :: IsContent c => Connection -> Bucket -> Key -> R -> IO (Maybe ([c], VClock))Source
Retrieve a value. This may return multiple conflicting siblings. Choosing among them is your responsibility.
put :: IsContent c => Connection -> Bucket -> Key -> Maybe VClock -> c -> W -> DW -> IO ([c], VClock)Source
Store a single value. This may return multiple conflicting siblings. Choosing among them, and storing a new value, is your responsibility.
You should only supply Nothing
as a T.VClock
if you are sure
that the given bucket+key combination does not already exist. If
you omit a T.VClock
but the bucket+key does exist, your value
will not be stored.
put_ :: IsContent c => Connection -> Bucket -> Key -> Maybe VClock -> c -> W -> DW -> IO ()Source
Store a single value, without the possibility of conflict resolution.
You should only supply Nothing
as a T.VClock
if you are sure
that the given bucket+key combination does not already exist. If
you omit a T.VClock
but the bucket+key does exist, your value
will not be stored, and you will not be notified.
putMany :: IsContent c => Connection -> Bucket -> [(Key, Maybe VClock, c)] -> W -> DW -> IO [([c], VClock)]Source
Store many values. This may return multiple conflicting siblings for each value stored. Choosing among them, and storing a new value in each case, is your responsibility.
You should only supply Nothing
as a T.VClock
if you are sure
that the given bucket+key combination does not already exist. If
you omit a T.VClock
but the bucket+key does exist, your value
will not be stored.
putMany_ :: IsContent c => Connection -> Bucket -> [(Key, Maybe VClock, c)] -> W -> DW -> IO ()Source
Store many values, without the possibility of conflict resolution.
You should only supply Nothing
as a T.VClock
if you are sure
that the given bucket+key combination does not already exist. If
you omit a T.VClock
but the bucket+key does exist, your value
will not be stored, and you will not be notified.