Safe Haskell | None |
---|---|
Language | Haskell98 |
- 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 ()
- serverInfo :: RethinkDBHandle -> IO Datum
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 (note: IPv4 and IPv6 supported)
>>>
h <- connect "localhost" 28015 Nothing
>>> h <- connect "::1" 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 #
Cursor | |
|
nextResponse :: Response -> IO () Source #
The response to a query
data RethinkDBError Source #
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
serverInfo :: RethinkDBHandle -> IO Datum Source #
Get information about the server