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

Release as version 3.0.1

parents 796ac473 030557ae
name: cql name: cql
version: 3.0.0 version: 3.0.1
synopsis: Cassandra CQL binary protocol. synopsis: Cassandra CQL binary protocol.
stability: experimental stability: experimental
license: OtherLicense license: OtherLicense
...@@ -70,6 +70,7 @@ test-suite cql-tests ...@@ -70,6 +70,7 @@ test-suite cql-tests
main-is: Main.hs main-is: Main.hs
hs-source-dirs: test hs-source-dirs: test
ghc-options: -threaded -Wall -O2 -fwarn-tabs ghc-options: -threaded -Wall -O2 -fwarn-tabs
other-modules: Tests
build-depends: build-depends:
base base
......
...@@ -19,9 +19,25 @@ import Data.UUID (UUID) ...@@ -19,9 +19,25 @@ import Data.UUID (UUID)
import Database.CQL.Protocol.Types import Database.CQL.Protocol.Types
-- | A type that can be converted from and to some CQL 'Value'. -- | 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 class Cql a where
ctype :: Tagged a ColumnType -- | the column-type of @a@
toCql :: a -> Value 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 fromCql :: Value -> Either String a
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
......
...@@ -26,7 +26,7 @@ newtype Table = Table ...@@ -26,7 +26,7 @@ newtype Table = Table
newtype PagingState = PagingState newtype PagingState = PagingState
{ unPagingState :: LB.ByteString } deriving (Eq, Show) { unPagingState :: LB.ByteString } deriving (Eq, Show)
-- | ID representing a perpared query. -- | ID representing a prepared query.
newtype QueryId k a b = QueryId newtype QueryId k a b = QueryId
{ unQueryId :: ByteString } deriving (Eq, Show) { 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