rethinkdb-wereHamster-1.8.0.5: RethinkDB driver for Haskell

Safe HaskellNone
LanguageHaskell98

Database.RethinkDB.Network

Synopsis

Documentation

data RethinkDBHandle Source

A connection to the database server

Constructors

RethinkDBHandle 

Fields

rdbHandle :: Handle
 
rdbWriteLock :: MVar (Maybe SomeException)
 
rdbToken :: IORef Token

The next token to use

rdbDatabase :: Database

The default database

rdbWait :: IORef (Map Token (Chan Response, BaseReQL, IO ()))
 
rdbThread :: ThreadId
 

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.

data Cursor a Source

Instances

next :: Cursor a -> IO (Maybe a) Source

Get the next value from a cursor

collect :: Cursor a -> IO [a] Source

A lazy stream of all the elements in the cursor

data Response Source

The raw response to a query