cql-4.0.0: Cassandra CQL binary protocol.

Safe HaskellNone
LanguageHaskell2010

Database.CQL.Protocol.Internal

Contents

Description

Like Database.CQL.Protocol but exports the whole encode/decode machinery for all types.

Synopsis

Cql type-class

class Cql a where Source #

A type that can be converted from and to some CQL Value.

This type-class is used to map custom types to Cassandra data-types. For example:

newtype MyType = MyType Int32

instance Cql MyType where
    ctype              = Tagged IntColumn
    toCql (MyType i)   = CqlInt i
    fromCql (CqlInt i) = Right (MyType i)
    fromCql _          = Left "Expected CqlInt"

Minimal complete definition

ctype, toCql, fromCql

Methods

ctype :: Tagged a ColumnType Source #

the column-type of a

toCql :: a -> Value Source #

map a to some CQL data-type

fromCql :: Value -> Either String a Source #

map a CQL value back to a

Instances

Cql Bool Source # 
Cql Double Source # 
Cql Float Source # 
Cql Int8 Source # 
Cql Int16 Source # 
Cql Int32 Source # 
Cql Int64 Source # 
Cql Integer Source # 
Cql Decimal Source # 
Cql IP Source # 
Cql Text Source # 
Cql UTCTime Source # 
Cql UUID Source # 
Cql TimeUuid Source # 
Cql Counter Source # 
Cql Blob Source # 
Cql Ascii Source # 
Cql a => Cql [a] Source # 
Cql a => Cql (Maybe a) Source #

Please note that due to the fact that Cassandra internally represents empty collection type values (i.e. lists, maps and sets) as null, we can not distinguish Just [] from Nothing on response decoding.

Cql a => Cql (Set a) Source # 
(Cql a1, Cql a2) => Cql (a1, a2) Source # 

Methods

ctype :: Tagged (a1, a2) ColumnType Source #

toCql :: (a1, a2) -> Value Source #

fromCql :: Value -> Either String (a1, a2) Source #

(Cql a, Cql b) => Cql (Map a b) Source # 
(Cql a1, Cql a2, Cql a3) => Cql (a1, a2, a3) Source # 

Methods

ctype :: Tagged (a1, a2, a3) ColumnType Source #

toCql :: (a1, a2, a3) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3) Source #

(Cql a1, Cql a2, Cql a3, Cql a4) => Cql (a1, a2, a3, a4) Source # 

Methods

ctype :: Tagged (a1, a2, a3, a4) ColumnType Source #

toCql :: (a1, a2, a3, a4) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3, a4) Source #

(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5) => Cql (a1, a2, a3, a4, a5) Source # 

Methods

ctype :: Tagged (a1, a2, a3, a4, a5) ColumnType Source #

toCql :: (a1, a2, a3, a4, a5) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3, a4, a5) Source #

(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6) => Cql (a1, a2, a3, a4, a5, a6) Source # 

Methods

ctype :: Tagged (a1, a2, a3, a4, a5, a6) ColumnType Source #

toCql :: (a1, a2, a3, a4, a5, a6) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3, a4, a5, a6) Source #

(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7) => Cql (a1, a2, a3, a4, a5, a6, a7) Source # 

Methods

ctype :: Tagged (a1, a2, a3, a4, a5, a6, a7) ColumnType Source #

toCql :: (a1, a2, a3, a4, a5, a6, a7) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3, a4, a5, a6, a7) Source #

(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8) => Cql (a1, a2, a3, a4, a5, a6, a7, a8) Source # 

Methods

ctype :: Tagged (a1, a2, a3, a4, a5, a6, a7, a8) ColumnType Source #

toCql :: (a1, a2, a3, a4, a5, a6, a7, a8) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3, a4, a5, a6, a7, a8) Source #

(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9) => Cql (a1, a2, a3, a4, a5, a6, a7, a8, a9) Source # 

Methods

ctype :: Tagged (a1, a2, a3, a4, a5, a6, a7, a8, a9) ColumnType Source #

toCql :: (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3, a4, a5, a6, a7, a8, a9) Source #

(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10) => Cql (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) Source # 

Methods

ctype :: Tagged (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) ColumnType Source #

toCql :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) Source #

(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11) => Cql (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) Source # 

Methods

ctype :: Tagged (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) ColumnType Source #

toCql :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) Source #

(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12) => Cql (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) Source # 

Methods

ctype :: Tagged (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) ColumnType Source #

toCql :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) Source #

(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13) => Cql (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) Source # 

Methods

ctype :: Tagged (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) ColumnType Source #

toCql :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) Source #

(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14) => Cql (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) Source # 

Methods

ctype :: Tagged (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) ColumnType Source #

toCql :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) Source #

(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15) => Cql (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) Source # 

Methods

ctype :: Tagged (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) ColumnType Source #

toCql :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) Source #

(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16) => Cql (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) Source # 

Methods

ctype :: Tagged (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) ColumnType Source #

toCql :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) -> Value Source #

fromCql :: Value -> Either String (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) Source #

Basic type definitions

newtype Keyspace Source #

Constructors

Keyspace 

Fields

newtype Table Source #

Constructors

Table 

Fields

Instances

Eq Table Source # 

Methods

(==) :: Table -> Table -> Bool #

(/=) :: Table -> Table -> Bool #

Show Table Source # 

Methods

showsPrec :: Int -> Table -> ShowS #

show :: Table -> String #

showList :: [Table] -> ShowS #

newtype PagingState Source #

Opaque token passed to the server to continue result paging.

Constructors

PagingState 

newtype QueryId k a b Source #

ID representing a prepared query.

Constructors

QueryId 

Instances

Eq (QueryId k a b) Source # 

Methods

(==) :: QueryId k a b -> QueryId k a b -> Bool #

(/=) :: QueryId k a b -> QueryId k a b -> Bool #

Show (QueryId k a b) Source # 

Methods

showsPrec :: Int -> QueryId k a b -> ShowS #

show :: QueryId k a b -> String #

showList :: [QueryId k a b] -> ShowS #

newtype QueryString k a b Source #

Constructors

QueryString 

Fields

Instances

Eq (QueryString k a b) Source # 

Methods

(==) :: QueryString k a b -> QueryString k a b -> Bool #

(/=) :: QueryString k a b -> QueryString k a b -> Bool #

Show (QueryString k a b) Source # 

Methods

showsPrec :: Int -> QueryString k a b -> ShowS #

show :: QueryString k a b -> String #

showList :: [QueryString k a b] -> ShowS #

IsString (QueryString k a b) Source # 

Methods

fromString :: String -> QueryString k a b #

data Version Source #

CQL binary protocol version.

Constructors

V3

version 3

V4

version 4

data CqlVersion Source #

The CQL version (not the binary protocol version).

Constructors

Cqlv300 
CqlVersion !Text 

data Consistency Source #

Consistency level.

See: Consistency

Constructors

Any 
One 
LocalOne 
Two 
Three 
Quorum 
LocalQuorum 
All 
EachQuorum

Only for write queries.

Serial

Only for read queries.

LocalSerial

Only for read queries.

newtype Blob Source #

Constructors

Blob 

Fields

Instances

newtype Set a Source #

Constructors

Set 

Fields

Instances

(Eq a, Ord a) => Eq (Set a) Source # 

Methods

(==) :: Set a -> Set a -> Bool #

(/=) :: Set a -> Set a -> Bool #

Show a => Show (Set a) Source # 

Methods

showsPrec :: Int -> Set a -> ShowS #

show :: Set a -> String #

showList :: [Set a] -> ShowS #

Cql a => Cql (Set a) Source # 

newtype Map a b Source #

Constructors

Map 

Fields

Instances

(Eq k, Eq v, Ord k) => Eq (Map k v) Source # 

Methods

(==) :: Map k v -> Map k v -> Bool #

(/=) :: Map k v -> Map k v -> Bool #

(Show b, Show a) => Show (Map a b) Source # 

Methods

showsPrec :: Int -> Map a b -> ShowS #

show :: Map a b -> String #

showList :: [Map a b] -> ShowS #

(Cql a, Cql b) => Cql (Map a b) Source # 

newtype Tagged a b Source #

Tag some value with a phantom type.

Constructors

Tagged 

Fields

retag :: Tagged a c -> Tagged b c Source #

data R Source #

Type tag for read queries, i.e. 'QueryString R a b'.

data W Source #

Type tag for write queries, i.e. 'QueryString W a b'.

data S Source #

Type tag for schema queries, i.e. 'QueryString S a b'.

Header

data Header Source #

Protocol frame header.

Instances

data HeaderType Source #

Constructors

RqHeader

A request frame header.

RsHeader

A response frame header.

header :: Version -> ByteString -> Either String Header Source #

Deserialise a frame header using the version specific decoding format.

Length

newtype Length Source #

The type denoting a protocol frame length.

Constructors

Length 

Fields

Instances

StreamId

data StreamId Source #

Streams allow multiplexing of requests over a single communication channel. The StreamId correlates Requests with Responses.

mkStreamId :: Integral i => i -> StreamId Source #

Create a StreamId from the given integral value. In version 2, a StreamId is an Int8 and in version 3 an Int16.

fromStreamId :: StreamId -> Int Source #

Convert the stream ID to an integer.

Flags

data Flags Source #

Type representing header flags. Flags form a monoid and can be used as in compress <> tracing <> mempty.

Instances

compress :: Flags Source #

Compression flag. If set, the frame body is compressed.

tracing :: Flags Source #

Tracing flag. If a request support tracing and the tracing flag was set, the response to this request will have the tracing flag set and contain tracing information.

isSet :: Flags -> Flags -> Bool Source #

Check if a particular flag is present.

Request

data Request k a b Source #

The type corresponding to the protocol request frame.

The type parameter k denotes the kind of request. It is present to allow distinguishing read operations from write operations. Use R for read, W for write and S for schema related operations.

a represents the argument type and b the return type of this request.

Instances

Show a => Show (Request k a b) Source # 

Methods

showsPrec :: Int -> Request k a b -> ShowS #

show :: Request k a b -> String #

showList :: [Request k a b] -> ShowS #

pack Source #

Arguments

:: Tuple a 
=> Version

protocol version, which determines the encoding

-> Compression

compression to use

-> Bool

enable/disable tracing

-> StreamId

the stream Id to use

-> Request k a b

the actual request to serialise

-> Either String ByteString 

Serialise the given request, optionally using compression. The result is either an error description in case of failure or a binary protocol frame, including Header, Length and body.

getOpCode :: Request k a b -> OpCode Source #

Get the protocol OpCode corresponding to the given Request.

Options

data Options Source #

An options request, send prior to Startup to request the server's startup options.

Constructors

Options 

Instances

Startup

data Startup Source #

A startup request which is used when initialising a connection to the server. It specifies the CQL version to use and optionally the compression algorithm.

Instances

Auth Response

newtype AuthResponse Source #

A request send in response to a previous authentication challenge.

Constructors

AuthResponse ByteString 

Register

newtype Register Source #

Register's the connection this request is made through, to receive server events.

Constructors

Register [EventType] 

data EventType Source #

Event types to register.

Constructors

TopologyChangeEvent

events related to change in the cluster topology

StatusChangeEvent

events related to change of node status

SchemaChangeEvent

events related to schema change

Query

data Query k a b Source #

A CQL query (select, insert, etc.).

Constructors

Query !(QueryString k a b) !(QueryParams a) 

Instances

Show a => Show (Query k a b) Source # 

Methods

showsPrec :: Int -> Query k a b -> ShowS #

show :: Query k a b -> String #

showList :: [Query k a b] -> ShowS #

data QueryParams a Source #

Query parameters.

Constructors

QueryParams 

Fields

  • consistency :: !Consistency

    (Regular) consistency level to use.

  • skipMetaData :: !Bool

    Whether to omit the metadata in the Response of the query. This is an optimisation only relevant for use with prepared queries, for which the metadata obtained from the PreparedResult may be reused.

  • values :: a

    The bound parameters of the query.

  • pageSize :: Maybe Int32

    The desired maximum result set size.

  • queryPagingState :: Maybe PagingState

    The current paging state that determines the "offset" of the results to return for a read query.

  • serialConsistency :: Maybe SerialConsistency

    Serial consistency level to use for conditional updates (aka "lightweight transactions"). Irrelevant for any other queries.

  • enableTracing :: Maybe Bool

    Whether tracing should be enabled for the query, in which case the Response will carry a traceId.

Instances

data SerialConsistency Source #

Consistency level for the serial phase of conditional updates (aka "lightweight transactions").

See: SerialConsistency

Constructors

SerialConsistency

Default. Quorum-based linearizable consistency.

LocalSerialConsistency

Like SerialConsistency except confined to a single (logical) data center.

Batch

data Batch Source #

Allows executing a list of queries (prepared or not) as a batch.

Instances

data BatchQuery where Source #

A GADT to unify queries and prepared queries both of which can be used in batch requests.

Constructors

BatchQuery :: (Show a, Tuple a, Tuple b) => !(QueryString W a b) -> !a -> BatchQuery 
BatchPrepared :: (Show a, Tuple a, Tuple b) => !(QueryId W a b) -> !a -> BatchQuery 

data BatchType Source #

Constructors

BatchLogged

default, uses a batch log for atomic application

BatchUnLogged

skip the batch log

BatchCounter

used for batched counter updates

Prepare

newtype Prepare k a b Source #

Prepare a query for later execution (cf. Execute).

Constructors

Prepare (QueryString k a b) 

Instances

Show (Prepare k a b) Source # 

Methods

showsPrec :: Int -> Prepare k a b -> ShowS #

show :: Prepare k a b -> String #

showList :: [Prepare k a b] -> ShowS #

Execute

data Execute k a b Source #

Executes a prepared query.

Constructors

Execute !(QueryId k a b) !(QueryParams a) 

Instances

Show a => Show (Execute k a b) Source # 

Methods

showsPrec :: Int -> Execute k a b -> ShowS #

show :: Execute k a b -> String #

showList :: [Execute k a b] -> ShowS #

Response

data Response k a b Source #

The type corresponding to the protocol response frame.

The type parameter k denotes the kind of response. It is present to allow distinguishing read operations from write operations. Use R for read, W for write and S for schema related operations.

a represents the argument type and b the return type of this response.

Instances

Show b => Show (Response k a b) Source # 

Methods

showsPrec :: Int -> Response k a b -> ShowS #

show :: Response k a b -> String #

showList :: [Response k a b] -> ShowS #

warnings :: Response k a b -> [Text] Source #

Get server warnings from response if any.

traceId :: Response k a b -> Maybe UUID Source #

Get server trace ID from response if any.

unpack :: (Tuple a, Tuple b) => Compression -> Header -> ByteString -> Either String (Response k a b) Source #

Deserialise a Response from the given ByteString.

Ready

data Ready Source #

The server is ready to process queries. Response of a Startup request.

Constructors

Ready 

Instances

Authenticate

newtype Authenticate Source #

The server requires authentication.

Constructors

Authenticate Text 

newtype AuthChallenge Source #

A server-send authentication challenge.

newtype AuthSuccess Source #

Indicates the success of an authentication phase.

Constructors

AuthSuccess (Maybe ByteString) 

Result

data Result k a b Source #

Query response.

Instances

Show b => Show (Result k a b) Source # 

Methods

showsPrec :: Int -> Result k a b -> ShowS #

show :: Result k a b -> String #

showList :: [Result k a b] -> ShowS #

data MetaData Source #

Part of a RowsResult. Describes the result set.

data ColumnSpec Source #

The column specification. Part of MetaData unless skipMetaData in QueryParams was True.

Constructors

ColumnSpec 

decodeResult :: forall k a b. (Tuple a, Tuple b) => Version -> Get (Result k a b) Source #

Supported

data Supported Source #

The startup options supported by the server. Response of an Options request.

Event

data Event Source #

Messages send by the server without request, if the connection has been Registered to receive such events.

Instances

Error

data Error Source #

Error response.

Tuple and Record

class PrivateTuple a => Tuple a Source #

Instances

Tuple () Source # 
Tuple Row Source # 
Cql a => Tuple (Identity a) Source # 
(Cql a1, Cql a2) => Tuple (a1, a2) Source # 
(Cql a1, Cql a2, Cql a3) => Tuple (a1, a2, a3) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4) => Tuple (a1, a2, a3, a4) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5) => Tuple (a1, a2, a3, a4, a5) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6) => Tuple (a1, a2, a3, a4, a5, a6) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7) => Tuple (a1, a2, a3, a4, a5, a6, a7) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35, Cql a36) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35, Cql a36, Cql a37) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35, Cql a36, Cql a37, Cql a38) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35, Cql a36, Cql a37, Cql a38, Cql a39) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35, Cql a36, Cql a37, Cql a38, Cql a39, Cql a40) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, a40) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35, Cql a36, Cql a37, Cql a38, Cql a39, Cql a40, Cql a41) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, a40, a41) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35, Cql a36, Cql a37, Cql a38, Cql a39, Cql a40, Cql a41, Cql a42) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, a40, a41, a42) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35, Cql a36, Cql a37, Cql a38, Cql a39, Cql a40, Cql a41, Cql a42, Cql a43) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, a40, a41, a42, a43) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35, Cql a36, Cql a37, Cql a38, Cql a39, Cql a40, Cql a41, Cql a42, Cql a43, Cql a44) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, a40, a41, a42, a43, a44) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35, Cql a36, Cql a37, Cql a38, Cql a39, Cql a40, Cql a41, Cql a42, Cql a43, Cql a44, Cql a45) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, a40, a41, a42, a43, a44, a45) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35, Cql a36, Cql a37, Cql a38, Cql a39, Cql a40, Cql a41, Cql a42, Cql a43, Cql a44, Cql a45, Cql a46) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, a40, a41, a42, a43, a44, a45, a46) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35, Cql a36, Cql a37, Cql a38, Cql a39, Cql a40, Cql a41, Cql a42, Cql a43, Cql a44, Cql a45, Cql a46, Cql a47) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, a40, a41, a42, a43, a44, a45, a46, a47) Source # 
(Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11, Cql a12, Cql a13, Cql a14, Cql a15, Cql a16, Cql a17, Cql a18, Cql a19, Cql a20, Cql a21, Cql a22, Cql a23, Cql a24, Cql a25, Cql a26, Cql a27, Cql a28, Cql a29, Cql a30, Cql a31, Cql a32, Cql a33, Cql a34, Cql a35, Cql a36, Cql a37, Cql a38, Cql a39, Cql a40, Cql a41, Cql a42, Cql a43, Cql a44, Cql a45, Cql a46, Cql a47, Cql a48) => Tuple (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, a40, a41, a42, a43, a44, a45, a46, a47, a48) Source # 

count :: PrivateTuple a => Tagged a Int Source #

check :: PrivateTuple a => Tagged a ([ColumnType] -> [ColumnType]) Source #

tuple :: PrivateTuple a => Version -> [ColumnType] -> Get a Source #

store :: PrivateTuple a => Version -> Putter a Source #

data Row Source #

A row is a vector of Values.

Instances

Eq Row Source # 

Methods

(==) :: Row -> Row -> Bool #

(/=) :: Row -> Row -> Bool #

Show Row Source # 

Methods

showsPrec :: Int -> Row -> ShowS #

show :: Row -> String #

showList :: [Row] -> ShowS #

Tuple Row Source # 

fromRow :: Cql a => Int -> Row -> Either String a Source #

Convert a row element.

class Record a where Source #

Record/Tuple conversion. For example:

data Peer = Peer
    { peerAddr :: IP
    , peerRPC  :: IP
    , peerDC   :: Text
    , peerRack :: Text
    } deriving Show

recordInstance ''Peer

map asRecord <$> performQuery "SELECT peer, rpc_address, data_center, rack FROM system.peers"

The generated type-class instance maps between record and tuple constructors:

type instance TupleType Peer = (IP, IP, Text, Text)

instance Record Peer where
    asTuple (Peer a b c d) = (a, b, c, d)
    asRecord (a, b, c, d)  = Peer a b c d

Minimal complete definition

asTuple, asRecord

Methods

asTuple :: a -> TupleType a Source #

asRecord :: TupleType a -> a Source #

type family TupleType a Source #

Codec