Safe Haskell | None |
---|---|
Language | Haskell98 |
- data RethinkDBHandle = RethinkDBHandle {}
- connect :: HostName -> Integer -> Maybe String -> IO RethinkDBHandle
- close :: RethinkDBHandle -> IO ()
- use :: RethinkDBHandle -> Database -> RethinkDBHandle
- runQLQuery :: RethinkDBHandle -> Query -> BaseReQL -> IO (MVar Response)
- data Cursor a
- makeCursor :: MVar Response -> IO (Cursor Datum)
- next :: Cursor a -> IO (Maybe a)
- collect :: Cursor a -> IO [a]
- nextResponse :: Response -> IO ()
- data Response
- = ErrorResponse { }
- | SuccessResponse {
- successCode :: SuccessCode
- successDatums :: [Datum]
- data SuccessCode
- data ErrorCode
- data RethinkDBError = RethinkDBError {}
- data RethinkDBConnectionError = RethinkDBConnectionError ByteString
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 :: RethinkDBHandle -> Database -> 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 -> Query -> BaseReQL -> IO (MVar Response) Source
nextResponse :: Response -> IO () Source
The raw response to a query