Safe Haskell | None |
---|
- run :: (Expr query, Result r) => RethinkDBHandle -> query -> IO r
- run' :: Expr query => RethinkDBHandle -> query -> IO Datum
- class Result r where
- convertResult :: MVar Response -> IO r
- runOpts :: (Expr query, Result r) => RethinkDBHandle -> [RunFlag] -> query -> IO r
- data RunFlag
- = UseOutdated
- | NoReply
- | Durability Durability
- | Profile
- | ArrayLimit Int
- data WriteResponse = WriteResponse {}
- data Change = Change {}
Documentation
run :: (Expr query, Result r) => RethinkDBHandle -> query -> IO r
Run a given query and return a Result
>>>
run h $ num 1 :: IO Int
1
>>>
run h $ str "foo" :: IO (Either RethinkDBError Int)
Left RethinkDB: Unexpected response: "when expecting a Int, encountered String instead"
>>>
run h $ str "foo" :: IO (Maybe Int)
Nothing
>>>
run h $ str "foo" :: IO Int
*** Exception: RethinkDB: Unexpected response: "when expecting a Int, encountered String instead"
>>>
c <- run h $ table "users" # orderBy [asc "name"] # (!"name"):: IO (Cursor Datum)
>>>
next c
Just "bill">>>
collect c
["nancy","sabrina"]
run' :: Expr query => RethinkDBHandle -> query -> IO Datum
Run a given query and return a Datum
class Result r where
Convert the raw query response into useful values
convertResult :: MVar Response -> IO r
runOpts :: (Expr query, Result r) => RethinkDBHandle -> [RunFlag] -> query -> IO r
Run a query with the given options
data WriteResponse