Safe Haskell | None |
---|---|
Language | Haskell98 |
- 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
- | ReadMode ReadMode
- | NoReply
- | Durability Durability
- | Profile
- | ArrayLimit Int
- data WriteResponse = WriteResponse {}
- data Change = Change {}
Documentation
run :: (Expr query, Result r) => RethinkDBHandle -> query -> IO r Source
Run a given query and return a Result
>>>
run h $ num 1 :: IO Int
1
>>> run h $ str "foo" :: IO (Either RethinkDBError Int)
- ** Exception: RethinkDB: Unexpected response: "expected Int, encountered String"
>>>
run h $ str "foo" :: IO (Maybe Int)
Nothing
>>> run h $ str "foo" :: IO Int
- ** Exception: RethinkDB: Unexpected response: "expected Int, encountered String"
>>>
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 Source
Run a given query and return a Datum
Convert the raw query response into useful values
Nothing
convertResult :: MVar Response -> IO r Source
runOpts :: (Expr query, Result r) => RethinkDBHandle -> [RunFlag] -> query -> IO r Source
Run a query with the given options
Per-query settings
UseOutdated | Deprecated. Use `ReadMode Outdated` instead |
ReadMode ReadMode | |
NoReply | |
Durability Durability | |
Profile | |
ArrayLimit Int |