Commit 2b65b0e5 authored by Toralf Wittner's avatar Toralf Wittner

Release as version 3.0.1

parents 796ac473 030557ae
name: cql
version: 3.0.0
version: 3.0.1
synopsis: Cassandra CQL binary protocol.
stability: experimental
license: OtherLicense
......@@ -70,6 +70,7 @@ test-suite cql-tests
main-is: Main.hs
hs-source-dirs: test
ghc-options: -threaded -Wall -O2 -fwarn-tabs
other-modules: Tests
build-depends:
base
......
......@@ -19,9 +19,25 @@ import Data.UUID (UUID)
import Database.CQL.Protocol.Types
-- | 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"
-- @
class Cql a where
ctype :: Tagged a ColumnType
toCql :: a -> Value
-- | the column-type of @a@
ctype :: Tagged a ColumnType
-- | map @a@ to some CQL data-type
toCql :: a -> Value
-- | map a CQL value back to @a@
fromCql :: Value -> Either String a
------------------------------------------------------------------------------
......
......@@ -26,7 +26,7 @@ newtype Table = Table
newtype PagingState = PagingState
{ unPagingState :: LB.ByteString } deriving (Eq, Show)
-- | ID representing a perpared query.
-- | ID representing a prepared query.
newtype QueryId k a b = QueryId
{ unQueryId :: ByteString } deriving (Eq, Show)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment