| 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
- runOpts :: (Expr query, Result r) => RethinkDBHandle -> [RunFlag] -> query -> IO r
- data RunFlag
- = UseOutdated
- | ReadMode ReadMode
- | NoReply
- | Durability Durability
- | Profile
- | ArrayLimit Int
- data Durability
- durability :: Durability -> Attribute a
- 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)
- ** 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 cJust "bill">>>collect c["bob","nancy"]
run' :: Expr query => RethinkDBHandle -> query -> IO Datum Source #
Run a given query and return a Datum
Convert the raw query response into useful values
Methods
convertResult :: MVar Response -> IO r Source #
convertResult :: FromDatum r => 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 |
durability :: Durability -> Attribute a Source #
Optional argument for soft durability writes