rethinkdb-1.16.0.0: A driver for RethinkDB 1.16

Safe HaskellNone
LanguageHaskell98

Database.RethinkDB.Driver

Synopsis

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)
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 Source

Run a given query and return a Datum

runOpts :: (Expr query, Result r) => RethinkDBHandle -> [RunFlag] -> query -> IO r Source

Run a query with the given options

data RunFlag Source

Per-query settings

Constructors

UseOutdated 
NoReply 
Durability Durability 
Profile 
ArrayLimit Int 

data Change Source

Constructors

Change 

Fields

oldVal :: Datum
 
newVal :: Datum