| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Database.RethinkDB.Driver
- 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 Int1
>>>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 cJust "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
Minimal complete definition
Nothing
Methods
convertResult :: MVar Response -> IO r Source
Instances
runOpts :: (Expr query, Result r) => RethinkDBHandle -> [RunFlag] -> query -> IO r Source
Run a query with the given options
Per-query settings
Constructors
| UseOutdated | Deprecated. Use `ReadMode Outdated` instead |
| ReadMode ReadMode | |
| NoReply | |
| Durability Durability | |
| Profile | |
| ArrayLimit Int |
data WriteResponse Source
Constructors
| WriteResponse | |