cassy-0.7.1: A high level driver for the Cassandra datastore

Safe HaskellNone

Database.Cassandra.Types

Synopsis

Documentation

data ModifyOperation a Source

Possible outcomes of a modify operation

Constructors

Update a 
Delete 
DoNothing 

Instances

data KeySelector Source

A Key range selector to use with getMulti.

Constructors

Keys [Key]

Just a list of keys to get

KeyRange KeyRangeType Key Key Int32

A range of keys to get. Remember that RandomPartitioner ranges may not mean much as keys are randomly assigned to nodes.

Instances

data KeyRangeType Source

Encodes the Key vs. Token options in the thrift API.

InclusiveRange ranges are just plain intuitive range queries. WrapAround ranges are also inclusive, but they wrap around the ring.

Constructors

InclusiveRange 
WrapAround 

Instances

data Selector Source

A column selector/filter statement for queries.

Remember that SuperColumns are always fully deserialized, so we don't offer a way to filter columns within a SuperColumn.

Column names and ranges are specified by any type that can be packed into a Cassandra column using the CasType typeclass.

Constructors

All

Return everything in Row

forall a . CasType a => ColNames [a]

Return specific columns or super-columns depending on the ColumnFamily

forall a b . (CasType a, CasType b) => SupNames a [b]

When deleting specific columns in a super column

forall a b . (CasType a, CasType b) => Range

Return a range of columns or super-columns.

range :: SelectorSource

A default starting point for range Selector. Use this so you don't run into ambiguous type variables when using Nothing.

 range = Range (Nothing :: Maybe ByteString) (Nothing :: Maybe ByteString) Regular 1024

data Order Source

Order in a range query

Constructors

Regular 
Reversed 

Instances

data Column Source

A Column is either a single key-value pair or a SuperColumn with an arbitrary number of key-value pairs

Constructors

SuperColumn ColumnName [Column] 
Column 

Fields

colKey :: ColumnName
 
colVal :: Value
 
colTS :: Maybe Int64

Last update timestamp; will be overridden during write/update ops

colTTL :: Maybe Int32

A TTL after which Cassandra will erase the column

type Row = [Column]Source

A full row is simply a sequence of columns

col :: ByteString -> ByteString -> ColumnSource

A short-hand for creating key-value Column values. This is pretty low level; you probably want to use packCol.

casRetryH :: Monad m => Int -> Handler m BoolSource

Exception handler that returns True for errors that may be resolved after a retry. So they are good candidates for retrying queries.

networkRetryH :: Monad m => Int -> Handler m BoolSource

IOExceptions should be retried

getTime :: IO Int64Source

Cassandra is VERY sensitive to its timestamp values. As a convention, timestamps are always in microseconds

data PageResult m a Source

Describes the result of a single pagination action

Constructors

PDone

Done, this is all I have.

Fields

pCache :: [a]
 
PMore

Here's a batch and there is more when you call the action.

Fields

pCache :: [a]
 
pMore :: m (PageResult m a)
 

Instances

class CKey a whereSource

A typeclass to enable using any string-like type for row and column keys

Instances

CKey String 
CKey ByteString 
CKey ByteString 
CKey Text 
CKey Text 
CKey [ByteString]

For easy composite keys, just serialize your data type to a list of bytestrings, we'll concat them and turn them into column keys.

fromColKey' :: CKey a => ByteString -> aSource

Raise an error if conversion fails