Safe Haskell | None |
---|
The core of the haskell client library for RethinkDB
- data RethinkDBHandle = RethinkDBHandle {}
- openConnection :: HostName -> Maybe PortID -> Maybe String -> IO RethinkDBHandle
- use :: RethinkDBHandle -> Database -> RethinkDBHandle
- closeConnection :: RethinkDBHandle -> IO ()
- recvAll :: RethinkDBHandle -> Int -> IO ByteString
- sendAll :: RethinkDBHandle -> ByteString -> IO ()
- getNewToken :: RethinkDBHandle -> IO Int64
- data ErrorCode
- data SuccessCode
- data Response
- = ErrorResponse {
- errorCode :: ErrorCode
- errorMessage :: String
- errorBacktrace :: [String]
- | SuccessResponse { }
- = ErrorResponse {
- convertResponse :: Either String Response -> Response
- showBacktrace :: [String] -> String
- runQLQuery :: RethinkDBHandle -> Query -> IO Response
- data Database = Database {}
- db :: String -> Database
- dbCreate :: String -> Query False Database
- dbDrop :: Database -> Query False ()
- dbList :: Query False [Database]
- data TableCreateOptions = TableCreateOptions {}
- data Table = Table {}
- tablePrimaryAttr :: Table -> String
- defaultPrimaryAttr :: Utf8
- table :: String -> Table
- tableCreate :: Table -> TableCreateOptions -> Query False Table
- tableDrop :: Table -> Query False ()
- tableList :: Database -> Query False [Table]
- uTableKey :: Table -> Utf8
- data Document = Document {}
- get :: (ToExpr e, ExprType e ~ StreamType True ObjectType, ToValue k) => e -> k -> ObjectExpr
- insert_or_upsert :: (ToValue a, ToValueType (ExprType a) ~ ObjectType) => Table -> [a] -> Bool -> WriteQuery [Document]
- insert :: (ToValue a, ToValueType (ExprType a) ~ ObjectType) => Table -> a -> WriteQuery Document
- insertMany :: (ToValue a, ToValueType (ExprType a) ~ ObjectType) => Table -> [a] -> WriteQuery [Document]
- upsert :: (ToValue a, ToValueType (ExprType a) ~ ObjectType) => Table -> a -> WriteQuery Document
- upsertMany :: (ToValue a, ToValueType (ExprType a) ~ ObjectType) => Table -> [a] -> WriteQuery [Document]
- update :: (ToExpr sel, ExprType sel ~ StreamType True out, ToMapping map, MappingFrom map ~ out, MappingTo map ~ ObjectType) => sel -> map -> WriteQuery ()
- replace :: (ToExpr sel, ExprIsView sel ~ True, ToJSON a) => sel -> a -> WriteQuery ()
- delete :: (ToExpr sel, ExprIsView sel ~ True) => sel -> WriteQuery ()
- data Query b a where
- Query :: {
- _queryBuild :: QueryM Query
- _queryExtract :: [Value] -> Either String a
- ViewQuery :: {
- _viewQueryBuild :: QueryM (Table, Query)
- _viewQueryExtract :: [(Document, Value)] -> Either String a
- Query :: {
- data WriteQuery a = WriteQuery {
- writeQueryBuild :: QueryM WriteQuery
- writeQueryExtract :: [Value] -> Either String a
- queryBuild :: Query w a -> QueryM (MaybeView w, Query)
- queryExtract :: Query w a -> MaybeView w -> [Value] -> Either String a
- type family If p a b :: k
- class ToBuildQuery a where
- type BuildViewQuery a :: Bool
- buildQuery :: a -> ([If (BuildViewQuery a) (Document, Value) Value] -> Either String b) -> Query (BuildViewQuery a) b
- class ToBuildQuery a => ToQuery a b | a -> b where
- toQuery :: a -> Query (BuildViewQuery a) b
- mapMSnd :: Monad m => (a -> m b) -> [(c, a)] -> m [(c, b)]
- data Proxy t = Proxy
- exprToQLQuery :: Expr t -> QueryM (MaybeView (ExprTypeIsView t), Query)
- exprViewQuery :: ExprTypeIsView t ~ True => ([Value] -> Either String [a]) -> Expr t -> Query True [(Document, a)]
- extractListOf :: ExtractValue t a => Proxy t -> [Value] -> Maybe [a]
- class ExtractValue t v | t -> v where
- extractValue :: Proxy t -> Value -> Maybe v
- run :: ToQuery a v => RethinkDBHandle -> a -> IO v
- runEither :: ToQuery a v => RethinkDBHandle -> a -> IO (Either String v)
- addDoc :: Table -> Value -> Either String (Document, Value)
- runMaybe :: ToQuery a v => RethinkDBHandle -> a -> IO (Maybe v)
- runRaw :: (ToBuildQuery q, JSONQuery (BuildViewQuery q)) => RethinkDBHandle -> q -> IO Response
- runJSON :: (JSONQuery (BuildViewQuery q), ToBuildQuery q) => RethinkDBHandle -> q -> IO [Value]
- class JSONQuery b where
- data Results a = Results {
- resultsHandle :: IORef (Maybe (RethinkDBHandle, Int64))
- resultsSeq :: IORef (Seq a)
- _resultsError :: IORef (Maybe String)
- resultsQueryView :: QueryViewPair [a]
- data QueryViewPair a where
- QueryViewPair :: Query w a -> MaybeView w -> QueryViewPair a
- runBatch :: ToQuery q [a] => RethinkDBHandle -> q -> IO (Results a)
- queryExtractResponse :: Query w [a] -> MaybeView w -> Response -> RethinkDBHandle -> Int64 -> (Maybe (RethinkDBHandle, Int64), Seq a, Maybe String)
- next :: Results a -> IO (Maybe a)
- collect :: Results a -> IO [a]
- resultsError :: Results a -> IO (Maybe String)
- type family ExprTypeIsView expr :: Bool
- type ExprIsView e = ExprTypeIsView (ExprType e)
- type family ExprTypeNoView t :: ExprTypeKind
- type family ExprValueType expr :: ValueTypeKind
- type family ExprTypeStreamType t :: ValueTypeKind
- data Expr t where
- Expr :: QueryM (MaybeView (ExprIsView (Expr t)), Term) -> Expr t
- SpotExpr :: Document -> Expr (StreamType True ObjectType)
- mkExpr :: ExprIsView (Expr t) ~ False => QueryM Term -> Expr t
- mkView :: ExprIsView (Expr t) ~ True => Table -> QueryM Term -> Expr t
- viewKeyAttr :: MaybeView b -> Utf8
- viewTable :: MaybeView True -> Table
- data MaybeView w where
- class ToExpr o where
- type ExprType o :: ExprTypeKind
- toExpr :: o -> Expr (ExprType o)
- type family ToValueType t :: ValueTypeKind
- class ToValue e where
- toValue :: e -> Expr (ValueType (ToValueType (ExprType e)))
- type family FromMaybe a m :: k
- type HasToStreamValueOf a b = FromMaybe a (ToStreamValue b) ~ a
- type ToStreamValue e = ToStreamTypeValue (ExprType e)
- type family ToStreamTypeValue t :: Maybe ValueTypeKind
- class ToExpr e => ToStream e where
- toStream :: e -> Expr (StreamType (ExprIsView e) (FromMaybe a (ToStreamValue e)))
- str :: String -> Text
- type HasValueType a v = (ToValue a, ToValueType (ExprType a) ~ v)
- type HaveValueType a b v = (HasValueType a v, HasValueType b v)
- type NumberExpr = Expr (ValueType NumberType)
- type BoolExpr = Expr (ValueType BoolType)
- type ObjectExpr = Expr (ValueType ObjectType)
- type ArrayExpr = Expr (ValueType ArrayType)
- type StringExpr = Expr (ValueType StringType)
- type ValueExpr t = Expr (ValueType t)
- type NumberStream = Expr (StreamType False NumberType)
- type BoolStream = Expr (StreamType False BoolType)
- type ArrayStream = Expr (StreamType False ArrayType)
- type StringStream = Expr (StreamType False StringType)
- type ObjectStream = Expr (StreamType False ObjectType)
- type Selection = Expr (StreamType True ObjectType)
- class CanCompare a
- class Sequence e where
- type SequenceType e t :: Constraint
- data Obj = Obj [Attribute]
- data Attribute = forall e . ToValue e => String := e
- obj :: [Attribute] -> Obj
- streamToArray :: (ToExpr e, ExprType e ~ StreamType w t) => e -> Expr (ValueType ArrayType)
- arrayToStream :: (ToExpr e, ExprType e ~ ValueType ArrayType) => e -> Expr (StreamType False t)
- data Mapping from to = Mapping (QueryM Mapping)
- class ToMapping map where
- type MappingFrom map :: ValueTypeKind
- type MappingTo map :: ValueTypeKind
- toMapping :: map -> Mapping (MappingFrom map) (MappingTo map)
- data QuerySettings = QuerySettings {
- _queryToken :: Int64
- _queryDB :: Database
- _queryVars :: [String]
- _queryUseOutdated :: Bool
- type QueryM = State QuerySettings
- runQueryM :: QueryM a -> QuerySettings -> (a, QuerySettings)
- initialVars :: [String]
- getToken :: QueryM Int64
- activeDB :: QueryM Database
- newVar :: QueryM String
- setUseOutdated :: ToExpr e => Bool -> e -> Expr (ExprType e)
- mappingToPredicate :: Mapping -> Predicate
- tableToTerm :: Table -> QueryM Term
- mapping :: ToMapping m => m -> QueryM Mapping
- expr :: ToExpr e => e -> QueryM Term
- exprV :: ToExpr e => e -> QueryM (MaybeView (ExprIsView e), Term)
- stream :: ToStream a => a -> QueryM Term
- value :: ToValue a => a -> QueryM Term
- toJsonTerm :: ToJSON a => a -> Term
- (.?) :: FromJSON a => Value -> String -> Maybe a
- whenSuccess :: FromJSON a => String -> (a -> Either String b) -> [Value] -> Either String b
- whenSuccess_ :: b -> [Value] -> Either String b
- decodeAny :: FromJSON a => ByteString -> Maybe a
- convert :: FromJSON a => Value -> Maybe a
- metaQuery :: QueryM MetaQuery -> QueryM Query
- packUInt :: Int -> ByteString
- unpackUInt :: ByteString -> Int
- op :: BuiltinType -> Builtin
- apply :: Builtin -> [QueryM Term] -> QueryM Term
- rapply :: [QueryM Term] -> Builtin -> QueryM Term
- simpleOp :: ExprIsView (Expr t) ~ False => BuiltinType -> [QueryM Term] -> Expr t
- withView :: MaybeView b -> QueryM Term -> QueryM (MaybeView b, Term)
- primaryAttr :: (ToExpr e, ExprTypeIsView (ExprType e) ~ True) => e -> String -> Expr (ExprType e)
- comparison :: ExprTypeIsView t ~ False => Comparison -> [QueryM Term] -> Expr t
- tableRef :: Table -> QueryM TableRef
- extractTerm :: ToExpr e => e -> Term
- dumpExpr :: ToExpr e => e -> String
- dumpTermPart :: Data a => String -> a -> String
Network
openConnection :: HostName -> Maybe PortID -> Maybe String -> IO RethinkDBHandleSource
Create a new connection to the database server
Example: connect using the default port (28015) and specifying the default database for all queries.
>>>
h <- openConnection "localhost" Nothing (Just "test")
use :: RethinkDBHandle -> Database -> RethinkDBHandleSource
Set the default connection
The new handle is an alias for the old one. Calling closeConnection on either one will close both.
>>>
let h' = h `use` (db "players")
closeConnection :: RethinkDBHandle -> IO ()Source
Close an open connection
>>>
closeConnection h
recvAll :: RethinkDBHandle -> Int -> IO ByteStringSource
Receive a fixed amoutn of data
sendAll :: RethinkDBHandle -> ByteString -> IO ()Source
Send a bytestring
getNewToken :: RethinkDBHandle -> IO Int64Source
Get a request token and increment the token counter
The raw response to a query
convertResponse :: Either String Response -> ResponseSource
showBacktrace :: [String] -> StringSource
runQLQuery :: RethinkDBHandle -> Query -> IO ResponseSource
Execute a raw protobuffer query and return the raw response
CRUD
A database, referenced by name
dbList :: Query False [Database]Source
List the databases on the server
>>>
run h $ dbList
[test, dev, prod]
data TableCreateOptions Source
Options used to create a table
A table description
Table | |
|
table :: String -> TableSource
Create a simple table refence with no associated database or primary key
>>>
table "music"
Another way to create table references is to use the Table constructor:
>>>
Table (Just "mydatabase") "music" (Just "tuneid")
tableCreate :: Table -> TableCreateOptions -> Query False TableSource
Create a table on the server
def
can be imported from Data.Default
>>>
t <- run h $ tableCreate (table "fruits") def
A reference to a document
Eq Document | |
Show Document | |
ToValue Document | |
ToExpr Document | |
ToStream Document | |
ToBuildQuery Document | |
(ToBuildQuery Document, FromJSON a) => ToQuery Document a | |
(ToBuildQuery Table, FromJSON a) => ToQuery Table [(Document, a)] | |
(ToBuildQuery (Expr (StreamType True v)), ExtractValue ValueTypeKind v a) => ToQuery (Expr (StreamType True v)) [(Document, a)] |
get :: (ToExpr e, ExprType e ~ StreamType True ObjectType, ToValue k) => e -> k -> ObjectExprSource
Get a document by primary key
insert_or_upsert :: (ToValue a, ToValueType (ExprType a) ~ ObjectType) => Table -> [a] -> Bool -> WriteQuery [Document]Source
insert :: (ToValue a, ToValueType (ExprType a) ~ ObjectType) => Table -> a -> WriteQuery DocumentSource
Insert a document into a table
>>>
d <- run h $ insert t (object ["name" .= "banana", "color" .= "red"])
insertMany :: (ToValue a, ToValueType (ExprType a) ~ ObjectType) => Table -> [a] -> WriteQuery [Document]Source
Insert many documents into a table
upsert :: (ToValue a, ToValueType (ExprType a) ~ ObjectType) => Table -> a -> WriteQuery DocumentSource
Insert a document into a table, overwriting a document with the same primary key if one exists.
upsertMany :: (ToValue a, ToValueType (ExprType a) ~ ObjectType) => Table -> [a] -> WriteQuery [Document]Source
Insert many documents into a table, overwriting any existing documents with the same primary key.
update :: (ToExpr sel, ExprType sel ~ StreamType True out, ToMapping map, MappingFrom map ~ out, MappingTo map ~ ObjectType) => sel -> map -> WriteQuery ()Source
Update a table
>>>
t <- run h $ tableCreate (table "example") def
>>>
run h $ insertMany t [object ["a" .= 1, "b" .= 11], object ["a" .= 2, "b" .= 12]]
>>>
run h $ update t (object ["b" .= 20])
>>>
run h $ t
replace :: (ToExpr sel, ExprIsView sel ~ True, ToJSON a) => sel -> a -> WriteQuery ()Source
Replace documents in a table
delete :: (ToExpr sel, ExprIsView sel ~ True) => sel -> WriteQuery ()Source
Delete one or more documents from a table
Queries
A query returning a
Query :: QueryM Query -> ([Value] -> Either String a) -> Query False a | |
| |
ViewQuery :: QueryM (Table, Query) -> ([(Document, Value)] -> Either String a) -> Query True a | |
|
Functor (Query w) | |
ToBuildQuery (Query w a) | |
ToBuildQuery (Query w a) => ToQuery (Query w a) a |
data WriteQuery a Source
WriteQuery | |
|
Functor WriteQuery | |
ToBuildQuery (WriteQuery a) | |
ToBuildQuery (WriteQuery a) => ToQuery (WriteQuery a) a |
queryBuild :: Query w a -> QueryM (MaybeView w, Query)Source
class ToBuildQuery a whereSource
Convert things like tables and documents into queries
type BuildViewQuery a :: BoolSource
buildQuery :: a -> ([If (BuildViewQuery a) (Document, Value) Value] -> Either String b) -> Query (BuildViewQuery a) bSource
ToBuildQuery Document | |
ToBuildQuery Table | |
ToBuildQuery (Expr (ValueType v)) | |
ToBuildQuery (Expr (StreamType False v)) | |
ToBuildQuery (Expr (StreamType True v)) | |
ToBuildQuery (WriteQuery a) | |
ToBuildQuery (Query w a) |
class ToBuildQuery a => ToQuery a b | a -> b whereSource
toQuery :: a -> Query (BuildViewQuery a) bSource
(ToBuildQuery Document, FromJSON a) => ToQuery Document a | |
(ToBuildQuery Table, FromJSON a) => ToQuery Table [(Document, a)] | |
(ToBuildQuery (Expr (ValueType v)), ExtractValue ValueTypeKind v a) => ToQuery (Expr (ValueType v)) a | |
ToBuildQuery (WriteQuery a) => ToQuery (WriteQuery a) a | |
(ToBuildQuery (Expr (StreamType False v)), ExtractValue ValueTypeKind v a) => ToQuery (Expr (StreamType False v)) [a] | |
(ToBuildQuery (Expr (StreamType True v)), ExtractValue ValueTypeKind v a) => ToQuery (Expr (StreamType True v)) [(Document, a)] | |
ToBuildQuery (Query w a) => ToQuery (Query w a) a |
exprToQLQuery :: Expr t -> QueryM (MaybeView (ExprTypeIsView t), Query)Source
exprViewQuery :: ExprTypeIsView t ~ True => ([Value] -> Either String [a]) -> Expr t -> Query True [(Document, a)]Source
extractListOf :: ExtractValue t a => Proxy t -> [Value] -> Maybe [a]Source
class ExtractValue t v | t -> v whereSource
extractValue :: Proxy t -> Value -> Maybe vSource
FromJSON a => ExtractValue ValueTypeKind OtherValueType a | |
ExtractValue ValueTypeKind NoneType () | |
(IsString a, FromJSON a) => ExtractValue ValueTypeKind StringType a | |
FromJSON a => ExtractValue ValueTypeKind ArrayType a | |
FromJSON a => ExtractValue ValueTypeKind ObjectType a | |
ExtractValue ValueTypeKind BoolType Bool | |
(Num a, FromJSON a) => ExtractValue ValueTypeKind NumberType a |
run :: ToQuery a v => RethinkDBHandle -> a -> IO vSource
Run a query on the connection
The return value depends on the type of the second argument.
When the return value is polymorphic, type annotations may be required.
>>>
run h $ table "fruits" :: IO [(Document, Value)]
runEither :: ToQuery a v => RethinkDBHandle -> a -> IO (Either String v)Source
Run a query on the connection, returning (Left message) on error
runMaybe :: ToQuery a v => RethinkDBHandle -> a -> IO (Maybe v)Source
Run a query on the connection, returning Nothing on error
runRaw :: (ToBuildQuery q, JSONQuery (BuildViewQuery q)) => RethinkDBHandle -> q -> IO ResponseSource
Run a query on the connection and return the raw response
runJSON :: (JSONQuery (BuildViewQuery q), ToBuildQuery q) => RethinkDBHandle -> q -> IO [Value]Source
Run a query on the connection and return the resulting JSON value
Results | |
|
data QueryViewPair a whereSource
QueryViewPair :: Query w a -> MaybeView w -> QueryViewPair a |
runBatch :: ToQuery q [a] => RethinkDBHandle -> q -> IO (Results a)Source
Run a query on the connection and a return a lazy result list
>>>
res <- runBatch h <- (arrayToStream [1,2,3] :: NumberStream)
>>>
next res
Just 1>>>
collect res
[2,3]
queryExtractResponse :: Query w [a] -> MaybeView w -> Response -> RethinkDBHandle -> Int64 -> (Maybe (RethinkDBHandle, Int64), Seq a, Maybe String)Source
next :: Results a -> IO (Maybe a)Source
Read the next value from a lazy query. Fetch it from the server if needed.
resultsError :: Results a -> IO (Maybe String)Source
Get the last error from a lazy query.
If both next and resultsError return Nothing, then all results have been fetched without error.
Expressions
type family ExprTypeIsView expr :: BoolSource
Can the Expr be written to? (updated or deleted)
type ExprIsView e = ExprTypeIsView (ExprType e)Source
type family ExprTypeNoView t :: ExprTypeKindSource
type family ExprValueType expr :: ValueTypeKindSource
The type of the value of an Expr
type family ExprTypeStreamType t :: ValueTypeKindSource
The type of the stream of an Expr
An RQL expression
Expr :: QueryM (MaybeView (ExprIsView (Expr t)), Term) -> Expr t | |
SpotExpr :: Document -> Expr (StreamType True ObjectType) |
Fractional (Expr (ValueType NumberType)) | |
Num (Expr (ValueType NumberType)) | |
ToValue (Expr (ValueType t)) | |
ToValue (Expr (StreamType w t)) | |
ToExpr (Expr t) | |
ToMapping (Expr (ValueType t)) | |
ToStream (Expr (ValueType ArrayType)) | |
ToExpr (Expr (StreamType w t)) => ToStream (Expr (StreamType w t)) | |
ToBuildQuery (Expr (ValueType v)) | |
ToBuildQuery (Expr (StreamType False v)) | |
ToBuildQuery (Expr (StreamType True v)) | |
(ToBuildQuery (Expr (ValueType v)), ExtractValue ValueTypeKind v a) => ToQuery (Expr (ValueType v)) a | |
(ToBuildQuery (Expr (StreamType False v)), ExtractValue ValueTypeKind v a) => ToQuery (Expr (StreamType False v)) [a] | |
(ToBuildQuery (Expr (StreamType True v)), ExtractValue ValueTypeKind v a) => ToQuery (Expr (StreamType True v)) [(Document, a)] |
viewKeyAttr :: MaybeView b -> Utf8Source
Convert something into an Expr
type ExprType o :: ExprTypeKindSource
type family ToValueType t :: ValueTypeKindSource
The result type of toValue
Convert something into a value Expr
type HasToStreamValueOf a b = FromMaybe a (ToStreamValue b) ~ aSource
type ToStreamValue e = ToStreamTypeValue (ExprType e)Source
type family ToStreamTypeValue t :: Maybe ValueTypeKindSource
class ToExpr e => ToStream e whereSource
toStream :: e -> Expr (StreamType (ExprIsView e) (FromMaybe a (ToStreamValue e)))Source
type HasValueType a v = (ToValue a, ToValueType (ExprType a) ~ v)Source
Aliases for type constraints on expressions
type HaveValueType a b v = (HasValueType a v, HasValueType b v)Source
type NumberExpr = Expr (ValueType NumberType)Source
Simple aliases for different Expr types
type ObjectExpr = Expr (ValueType ObjectType)Source
type StringExpr = Expr (ValueType StringType)Source
type NumberStream = Expr (StreamType False NumberType)Source
type BoolStream = Expr (StreamType False BoolType)Source
type ArrayStream = Expr (StreamType False ArrayType)Source
type StringStream = Expr (StreamType False StringType)Source
type ObjectStream = Expr (StreamType False ObjectType)Source
type Selection = Expr (StreamType True ObjectType)Source
class CanCompare a Source
What values can be compared with eq, ne, lt, gt, le and ge
A sequence is either a stream or an array
type SequenceType e t :: ConstraintSource
~ ValueTypeKind a ArrayType => Sequence (ValueType a) | |
Sequence (StreamType w t) |
streamToArray :: (ToExpr e, ExprType e ~ StreamType w t) => e -> Expr (ValueType ArrayType)Source
Convert a stream into an array
arrayToStream :: (ToExpr e, ExprType e ~ ValueType ArrayType) => e -> Expr (StreamType False t)Source
Convert an array into a stream
Mappings
class ToMapping map whereSource
Convert objects into mappings
type MappingFrom map :: ValueTypeKindSource
type MappingTo map :: ValueTypeKindSource
toMapping :: map -> Mapping (MappingFrom map) (MappingTo map)Source
QueryM Monad
data QuerySettings Source
QuerySettings | |
|
type QueryM = State QuerySettingsSource
runQueryM :: QueryM a -> QuerySettings -> (a, QuerySettings)Source
initialVars :: [String]Source
Utilities
mappingToPredicate :: Mapping -> PredicateSource
Convert a protobuf Mapping into a Predicate
tableToTerm :: Table -> QueryM TermSource
Convert a table to a raw protobuf term
toJsonTerm :: ToJSON a => a -> TermSource
build a raw protobuf Term
(.?) :: FromJSON a => Value -> String -> Maybe aSource
Test if a field is present in a json Value and return it
whenSuccess :: FromJSON a => String -> (a -> Either String b) -> [Value] -> Either String bSource
Helper function to handle responses to a query
whenSuccess_ :: b -> [Value] -> Either String bSource
same as whenSuccess, but ignore the response when there is no error
decodeAny :: FromJSON a => ByteString -> Maybe aSource
Like aeson's decode, but but works on numbers and strings, not only objects and arrays
metaQuery :: QueryM MetaQuery -> QueryM QuerySource
Extract the error message from a Response if there is an error | Help build meta queries
packUInt :: Int -> ByteStringSource
Convert an int to a 4-byte bytestring
unpackUInt :: ByteString -> IntSource
Convert a 4-bte byestring to an int
primaryAttr :: (ToExpr e, ExprTypeIsView (ExprType e) ~ True) => e -> String -> Expr (ExprType e)Source
comparison :: ExprTypeIsView t ~ False => Comparison -> [QueryM Term] -> Expr tSource
extractTerm :: ToExpr e => e -> TermSource
dumpTermPart :: Data a => String -> a -> StringSource