| Safe Haskell | Safe-Infered |
|---|
Database.Cassandra.Types
- data KeySelector
- data KeyRangeType
- mkKeyRange :: KeySelector -> KeyRange
- data Selector
- range :: Selector
- showCas :: CasType a => a -> String
- mkPredicate :: Selector -> SlicePredicate
- data Order
- renderOrd :: Order -> Bool
- reverseOrder :: Order -> Order
- type ColumnFamily = String
- type Key = ByteString
- type ColumnName = ByteString
- type Value = ByteString
- data Column
- = SuperColumn ColumnName [Column]
- | Column { }
- type Row = [Column]
- col :: ByteString -> ByteString -> Column
- mkThriftCol :: Column -> IO Column
- castColumn :: ColumnOrSuperColumn -> Either CassandraException Column
- castCol :: Column -> Either CassandraException Column
- castSuperCol :: SuperColumn -> Either CassandraException Column
- data CassandraException
- getTime :: IO Int64
- class CKey a where
- toColKey :: a -> ByteString
- fromColKey :: ByteString -> Either String a
- fromColKey' :: CKey a => ByteString -> a
Documentation
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
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 |
| forall a . CasType a => ColNames [a] | Return specific columns or super-columns depending on the |
| 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. |
Fields
| |
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
reverseOrder :: Order -> OrderSource
type ColumnFamily = StringSource
type Key = ByteStringSource
type ColumnName = ByteStringSource
type Value = ByteStringSource
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 | |
col :: ByteString -> ByteString -> ColumnSource
A short-hand for creating key-value Column values. This is
pretty low level; you probably want to use packCol.
mkThriftCol :: Column -> IO ColumnSource
data CassandraException Source
Cassandra is VERY sensitive to its timestamp values. As a convention, timestamps are always in microseconds
A typeclass to enable using any string-like type for row and column keys
Instances
| CKey String | |
| CKey ByteString | |
| CKey Text | |
| CKey ByteString | |
| 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