Safe Haskell | None |
---|---|
Language | Haskell98 |
Database.RethinkDB.Network
- data RethinkDBHandle = RethinkDBHandle {}
- connect :: HostName -> Integer -> Maybe String -> IO RethinkDBHandle
- close :: RethinkDBHandle -> IO ()
- use :: Database -> RethinkDBHandle -> RethinkDBHandle
- runQLQuery :: RethinkDBHandle -> WireQuery -> Term -> IO (MVar Response)
- data Cursor a = Cursor {
- cursorMBox :: MVar Response
- cursorBuffer :: MVar (Either RethinkDBError ([Datum], Bool))
- cursorMap :: Datum -> IO a
- makeCursor :: MVar Response -> IO (Cursor Datum)
- next :: Cursor a -> IO (Maybe a)
- nextBatch :: Cursor a -> IO [a]
- collect :: Cursor a -> IO [a]
- collect' :: Cursor a -> IO [a]
- nextResponse :: Response -> IO ()
- data Response
- data ErrorCode
- data RethinkDBError = RethinkDBError {}
- data RethinkDBConnectionError = RethinkDBConnectionError String
- data More
- noReplyWait :: RethinkDBHandle -> IO ()
- each :: Cursor a -> (a -> IO b) -> IO ()
Documentation
connect :: HostName -> Integer -> Maybe String -> IO RethinkDBHandle Source
Create a new connection to the database server
Example: connect using the default port with no passphrase
>>>
h <- connect "localhost" 28015 Nothing
close :: RethinkDBHandle -> IO () Source
Close an open connection
use :: Database -> RethinkDBHandle -> RethinkDBHandle Source
Set the default database
The new handle is an alias for the old one. Calling close on either one will close both.
runQLQuery :: RethinkDBHandle -> WireQuery -> Term -> IO (MVar Response) Source
Constructors
Cursor | |
Fields
|
nextResponse :: Response -> IO () Source
The response to a query
Constructors
ResponseError RethinkDBError | |
ResponseSingle Datum | |
ResponseBatch (Maybe More) [Datum] |
data RethinkDBError Source
Constructors
RethinkDBError | |
Fields
|
Instances
data RethinkDBConnectionError Source
Constructors
RethinkDBConnectionError String |
noReplyWait :: RethinkDBHandle -> IO () Source
Wait for NoReply queries to complete on the server
>>>
() <- runOpts h [NoReply] $ table "users" # get "bob" # update (\row -> merge row ["occupation" := "teacher"])
>>>
noReplyWait h