Safe Haskell | None |
---|---|
Language | Haskell2010 |
Like Database.CQL.Protocol but exports the whole encode/decode machinery for all types.
- class Cql a where
- newtype Keyspace = Keyspace {
- unKeyspace :: Text
- newtype Table = Table {}
- newtype PagingState = PagingState {}
- newtype QueryId k a b = QueryId {}
- newtype QueryString k a b = QueryString {}
- data Version
- data CqlVersion
- = Cqlv300
- | CqlVersion !Text
- data CompressionAlgorithm
- data Compression = Compression {
- algorithm :: !CompressionAlgorithm
- shrink :: ByteString -> Maybe ByteString
- expand :: ByteString -> Maybe ByteString
- noCompression :: Compression
- data Consistency
- = Any
- | One
- | Two
- | Three
- | Quorum
- | All
- | LocalQuorum
- | EachQuorum
- | Serial
- | LocalOne
- | LocalSerial
- data OpCode
- data ColumnType
- = CustomColumn !Text
- | AsciiColumn
- | BigIntColumn
- | BlobColumn
- | BooleanColumn
- | CounterColumn
- | DecimalColumn
- | DoubleColumn
- | FloatColumn
- | IntColumn
- | TextColumn
- | TimestampColumn
- | UuidColumn
- | VarCharColumn
- | VarIntColumn
- | TimeUuidColumn
- | InetColumn
- | MaybeColumn !ColumnType
- | ListColumn !ColumnType
- | SetColumn !ColumnType
- | MapColumn !ColumnType !ColumnType
- | TupleColumn [ColumnType]
- | UdtColumn !Keyspace !Text [(Text, ColumnType)]
- newtype Ascii = Ascii {}
- newtype Blob = Blob {}
- newtype Counter = Counter {
- fromCounter :: Int64
- newtype TimeUuid = TimeUuid {
- fromTimeUuid :: UUID
- newtype Set a = Set {
- fromSet :: [a]
- newtype Map a b = Map {
- fromMap :: [(a, b)]
- data Value
- = CqlCustom !ByteString
- | CqlBoolean !Bool
- | CqlInt !Int32
- | CqlBigInt !Int64
- | CqlVarInt !Integer
- | CqlFloat !Float
- | CqlDecimal !Decimal
- | CqlDouble !Double
- | CqlText !Text
- | CqlInet !IP
- | CqlUuid !UUID
- | CqlTimestamp !Int64
- | CqlAscii !Text
- | CqlBlob !ByteString
- | CqlCounter !Int64
- | CqlTimeUuid !UUID
- | CqlMaybe (Maybe Value)
- | CqlList [Value]
- | CqlSet [Value]
- | CqlMap [(Value, Value)]
- | CqlTuple [Value]
- | CqlUdt [(Text, Value)]
- newtype Tagged a b = Tagged {
- untag :: b
- retag :: Tagged a c -> Tagged b c
- data R
- data W
- data S
- data Header = Header {
- headerType :: !HeaderType
- version :: !Version
- flags :: !Flags
- streamId :: !StreamId
- opCode :: !OpCode
- bodyLength :: !Length
- data HeaderType
- header :: Version -> ByteString -> Either String Header
- encodeHeader :: Version -> HeaderType -> Flags -> StreamId -> OpCode -> Length -> PutM ()
- decodeHeader :: Version -> Get Header
- newtype Length = Length {
- lengthRepr :: Int32
- encodeLength :: Putter Length
- decodeLength :: Get Length
- data StreamId
- mkStreamId :: Integral i => i -> StreamId
- fromStreamId :: StreamId -> Int
- encodeStreamId :: Version -> Putter StreamId
- decodeStreamId :: Version -> Get StreamId
- data Flags
- compress :: Flags
- tracing :: Flags
- isSet :: Flags -> Flags -> Bool
- encodeFlags :: Putter Flags
- decodeFlags :: Get Flags
- data Request k a b
- pack :: Tuple a => Version -> Compression -> Bool -> StreamId -> Request k a b -> Either String ByteString
- encodeRequest :: Tuple a => Version -> Putter (Request k a b)
- getOpCode :: Request k a b -> OpCode
- data Options = Options
- encodeOptions :: Putter Options
- data Startup = Startup !CqlVersion !CompressionAlgorithm
- encodeStartup :: Putter Startup
- newtype AuthResponse = AuthResponse ByteString
- encodeAuthResponse :: Putter AuthResponse
- newtype Register = Register [EventType]
- data EventType
- encodeRegister :: Putter Register
- encodeEventType :: Putter EventType
- data Query k a b = Query !(QueryString k a b) !(QueryParams a)
- data QueryParams a = QueryParams {}
- data SerialConsistency
- encodeQuery :: Tuple a => Version -> Putter (Query k a b)
- encodeQueryParams :: forall a. Tuple a => Version -> Putter (QueryParams a)
- data Batch = Batch {}
- data BatchQuery where
- 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
- encodeBatch :: Version -> Putter Batch
- encodeBatchType :: Putter BatchType
- encodeBatchQuery :: Version -> Putter BatchQuery
- newtype Prepare k a b = Prepare (QueryString k a b)
- encodePrepare :: Putter (Prepare k a b)
- data Execute k a b = Execute !(QueryId k a b) !(QueryParams a)
- encodeExecute :: Tuple a => Version -> Putter (Execute k a b)
- data Response k a b
- = RsError (Maybe UUID) !Error
- | RsReady (Maybe UUID) !Ready
- | RsAuthenticate (Maybe UUID) !Authenticate
- | RsAuthChallenge (Maybe UUID) !AuthChallenge
- | RsAuthSuccess (Maybe UUID) !AuthSuccess
- | RsSupported (Maybe UUID) !Supported
- | RsResult (Maybe UUID) !(Result k a b)
- | RsEvent (Maybe UUID) !Event
- unpack :: (Tuple a, Tuple b) => Compression -> Header -> ByteString -> Either String (Response k a b)
- data Ready = Ready
- decodeReady :: Get Ready
- newtype Authenticate = Authenticate Text
- newtype AuthChallenge = AuthChallenge (Maybe ByteString)
- newtype AuthSuccess = AuthSuccess (Maybe ByteString)
- decodeAuthenticate :: Get Authenticate
- decodeAuthChallenge :: Get AuthChallenge
- decodeAuthSuccess :: Get AuthSuccess
- data Result k a b
- = VoidResult
- | RowsResult !MetaData [b]
- | SetKeyspaceResult !Keyspace
- | PreparedResult !(QueryId k a b) !MetaData !MetaData
- | SchemaChangeResult !SchemaChange
- data MetaData = MetaData {
- columnCount :: !Int32
- pagingState :: Maybe PagingState
- columnSpecs :: [ColumnSpec]
- data ColumnSpec = ColumnSpec {
- keyspace :: !Keyspace
- table :: !Table
- columnName :: !Text
- columnType :: !ColumnType
- decodeResult :: forall k a b. (Tuple a, Tuple b) => Version -> Get (Result k a b)
- decodeMetaData :: Get MetaData
- data Supported = Supported [CompressionAlgorithm] [CqlVersion]
- decodeSupported :: Get Supported
- data Event
- data TopologyChange
- data SchemaChange
- data StatusChange
- data Change
- decodeSchemaChange :: Version -> Get SchemaChange
- decodeChange :: Version -> Get Change
- decodeEvent :: Version -> Get Event
- decodeTopologyChange :: Get TopologyChange
- decodeStatusChange :: Get StatusChange
- data Error
- = AlreadyExists !Text !Keyspace !Table
- | BadCredentials !Text
- | ConfigError !Text
- | Invalid !Text
- | IsBootstrapping !Text
- | Overloaded !Text
- | ProtocolError !Text
- | ServerError !Text
- | SyntaxError !Text
- | TruncateError !Text
- | Unauthorized !Text
- | Unprepared !Text !ByteString
- | Unavailable { }
- | ReadTimeout { }
- | WriteTimeout { }
- data WriteType
- decodeError :: Get Error
- decodeWriteType :: Get WriteType
- class PrivateTuple a => Tuple a
- count :: PrivateTuple a => Tagged a Int
- check :: PrivateTuple a => Tagged a ([ColumnType] -> [ColumnType])
- tuple :: PrivateTuple a => Version -> Get a
- store :: PrivateTuple a => Version -> Putter a
- class Record a where
- type family TupleType a
- recordInstance :: Name -> Q [Dec]
- encodeByte :: Putter Word8
- decodeByte :: Get Word8
- encodeSignedByte :: Putter Int8
- decodeSignedByte :: Get Int8
- encodeShort :: Putter Word16
- decodeShort :: Get Word16
- encodeSignedShort :: Putter Int16
- decodeSignedShort :: Get Int16
- encodeInt :: Putter Int32
- decodeInt :: Get Int32
- encodeString :: Putter Text
- decodeString :: Get Text
- encodeLongString :: Putter Text
- decodeLongString :: Get Text
- encodeBytes :: Putter ByteString
- decodeBytes :: Get (Maybe ByteString)
- encodeShortBytes :: Putter ByteString
- decodeShortBytes :: Get ByteString
- encodeUUID :: Putter UUID
- decodeUUID :: Get UUID
- encodeList :: Putter [Text]
- decodeList :: Get [Text]
- encodeMap :: Putter [(Text, Text)]
- decodeMap :: Get [(Text, Text)]
- encodeMultiMap :: Putter [(Text, [Text])]
- decodeMultiMap :: Get [(Text, [Text])]
- encodeSockAddr :: Putter SockAddr
- decodeSockAddr :: Get SockAddr
- encodeConsistency :: Putter Consistency
- decodeConsistency :: Get Consistency
- encodeOpCode :: Putter OpCode
- decodeOpCode :: Get OpCode
- encodeColumnType :: Putter ColumnType
- decodeColumnType :: Get ColumnType
- encodePagingState :: Putter PagingState
- decodePagingState :: Get (Maybe PagingState)
- decodeKeyspace :: Get Keyspace
- decodeTable :: Get Table
- decodeQueryId :: Get (QueryId k a b)
- putValue :: Version -> Putter Value
- getValue :: Version -> ColumnType -> Get Value
Cql type-class
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"
ctype :: Tagged a ColumnType Source
the column-type of a
map a
to some CQL data-type
fromCql :: Value -> Either String a Source
map a CQL value back to a
Cql Bool | |
Cql Double | |
Cql Float | |
Cql Int32 | |
Cql Int64 | |
Cql Integer | |
Cql Decimal | |
Cql IP | |
Cql Text | |
Cql UTCTime | |
Cql UUID | |
Cql TimeUuid | |
Cql Counter | |
Cql Blob | |
Cql Ascii | |
Cql a => Cql [a] | |
Cql a => Cql (Maybe a) | Please note that due to the fact that Cassandra internally represents
empty collection type values (i.e. lists, maps and sets) as |
Cql a => Cql (Set a) | |
(Cql a, Cql b) => Cql (Map a b) |
Basic type definitions
newtype PagingState Source
Opaque token passed to the server to continue result paging.
ID representing a prepared query.
newtype QueryString k a b Source
Eq (QueryString k a b) | |
Show (QueryString k a b) | |
IsString (QueryString k a b) |
data CqlVersion Source
The CQL version (not the binary protocol version).
data Compression Source
Compression | |
|
data Consistency Source
Consistency level.
An opcode is a tag to distinguish protocol frame bodies.
data ColumnType Source
The type of a single CQL column.
A CQL value. The various constructors correspond to CQL data-types for individual columns in Cassandra.
CqlCustom !ByteString | |
CqlBoolean !Bool | |
CqlInt !Int32 | |
CqlBigInt !Int64 | |
CqlVarInt !Integer | |
CqlFloat !Float | |
CqlDecimal !Decimal | |
CqlDouble !Double | |
CqlText !Text | |
CqlInet !IP | |
CqlUuid !UUID | |
CqlTimestamp !Int64 | |
CqlAscii !Text | |
CqlBlob !ByteString | |
CqlCounter !Int64 | |
CqlTimeUuid !UUID | |
CqlMaybe (Maybe Value) | |
CqlList [Value] | |
CqlSet [Value] | |
CqlMap [(Value, Value)] | |
CqlTuple [Value] | binary protocol version >= 3 |
CqlUdt [(Text, Value)] | binary protocol version >= 3 |
Header
Protocol frame header.
Header | |
|
data HeaderType Source
header :: Version -> ByteString -> Either String Header Source
Deserialise a frame header using the version specific decoding format.
encodeHeader :: Version -> HeaderType -> Flags -> StreamId -> OpCode -> Length -> PutM () Source
decodeHeader :: Version -> Get Header Source
Length
The type denoting a protocol frame length.
StreamId
Streams allow multiplexing of requests over a single communication
channel. The StreamId
correlates Request
s with Response
s.
mkStreamId :: Integral i => i -> StreamId Source
fromStreamId :: StreamId -> Int Source
Convert the stream ID to an integer.
decodeStreamId :: Version -> Get StreamId Source
Flags
Type representing header flags. Flags form a monoid and can be used
as in compress <> tracing <> mempty
.
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.
Request
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.
:: 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 |
Options
An options request, send prior to Startup
to request the server's
startup options.
Startup
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.
Auth Response
newtype AuthResponse Source
A request send in response to a previous authentication challenge.
Register
Register's the connection this request is made through, to receive server events.
Event types to register.
TopologyChangeEvent | events related to change in the cluster topology |
StatusChangeEvent | events related to change of node status |
SchemaChangeEvent | events related to schema change |
Query
A CQL query (select, insert, etc.).
Query !(QueryString k a b) !(QueryParams a) |
data QueryParams a Source
Query parameters.
QueryParams | |
|
Show a => Show (QueryParams a) |
data SerialConsistency Source
Consistency level for the serial phase of conditional updates.
encodeQueryParams :: forall a. Tuple a => Version -> Putter (QueryParams a) Source
Batch
Allows executing a list of queries (prepared or not) as a batch.
data BatchQuery where Source
A GADT to unify queries and prepared queries both of which can be used in batch requests.
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 |
BatchLogged | default, uses a batch log for atomic application |
BatchUnLogged | skip the batch log |
BatchCounter | used for batched counter updates |
encodeBatch :: Version -> Putter Batch Source
Prepare
Prepare a query for later execution (cf. Execute
).
Prepare (QueryString k a b) |
encodePrepare :: Putter (Prepare k a b) Source
Execute
Executes a prepared query.
Execute !(QueryId k a b) !(QueryParams a) |
Response
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.
RsError (Maybe UUID) !Error | |
RsReady (Maybe UUID) !Ready | |
RsAuthenticate (Maybe UUID) !Authenticate | |
RsAuthChallenge (Maybe UUID) !AuthChallenge | |
RsAuthSuccess (Maybe UUID) !AuthSuccess | |
RsSupported (Maybe UUID) !Supported | |
RsResult (Maybe UUID) !(Result k a b) | |
RsEvent (Maybe UUID) !Event |
unpack :: (Tuple a, Tuple b) => Compression -> Header -> ByteString -> Either String (Response k a b) Source
Deserialise a Response
from the given ByteString
.
Ready
The server is ready to process queries. Response of a Startup
request.
Authenticate
newtype AuthChallenge Source
A server-send authentication challenge.
newtype AuthSuccess Source
Indicates the success of an authentication phase.
Result
Query response.
Part of a RowsResult
. Describes the result set.
MetaData | |
|
data ColumnSpec Source
The column specification. Part of MetaData
unless skipMetaData
in
QueryParams
was True.
ColumnSpec | |
|
Supported
The startup options supported by the server. Response of an Options
request.
Event
Messages send by the server without request, if the connection has
been Register
ed to receive such events.
data TopologyChange Source
data SchemaChange Source
decodeChange :: Version -> Get Change Source
decodeEvent :: Version -> Get Event Source
Error
Error response.
Tuple and Record
class PrivateTuple a => Tuple a Source
Tuple () | |
Cql a => Tuple (Identity a) | |
(Cql a0, Cql a1) => Tuple (a, a) | |
(Cql a0, Cql a1, Cql a2) => Tuple (a, a, a) | |
(Cql a0, Cql a1, Cql a2, Cql a3) => Tuple (a, a, a, a) | |
(Cql a0, Cql a1, Cql a2, Cql a3, Cql a4) => Tuple (a, a, a, a, a) | |
(Cql a0, Cql a1, Cql a2, Cql a3, Cql a4, Cql a5) => Tuple (a, a, a, a, a, a) | |
(Cql a0, Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6) => Tuple (a, a, a, a, a, a, a) | |
(Cql a0, Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7) => Tuple (a, a, a, a, a, a, a, a) | |
(Cql a0, Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8) => Tuple (a, a, a, a, a, a, a, a, a) | |
(Cql a0, Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9) => Tuple (a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10) => Tuple (a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, Cql a1, Cql a2, Cql a3, Cql a4, Cql a5, Cql a6, Cql a7, Cql a8, Cql a9, Cql a10, Cql a11) => Tuple (a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) | |
(Cql a0, 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 (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) |
check :: PrivateTuple a => Tagged a ([ColumnType] -> [ColumnType]) 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
recordInstance :: Name -> Q [Dec] Source
Codec
decodeByte :: Get Word8 Source
decodeBytes :: Get (Maybe ByteString) Source
decodeUUID :: Get UUID Source
encodeList :: Putter [Text] Source
decodeList :: Get [Text] Source
encodeMultiMap :: Putter [(Text, [Text])] Source
decodeMultiMap :: Get [(Text, [Text])] Source
decodeQueryId :: Get (QueryId k a b) Source