rethinkdb-2.2.0.9: A driver for RethinkDB 2.2

Safe HaskellNone
LanguageHaskell98

Database.RethinkDB.Network

Synopsis

Documentation

data RethinkDBHandle Source #

A connection to the database server

Constructors

RethinkDBHandle 

Fields

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.

data Cursor a Source #

Instances

Functor Cursor Source # 

Methods

fmap :: (a -> b) -> Cursor a -> Cursor b #

(<$) :: a -> Cursor b -> Cursor a #

FromDatum a => Result (Cursor a) Source # 

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

Get the next value from a cursor

nextBatch :: Cursor a -> IO [a] Source #

Get the next batch from a cursor

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

A lazy stream of all the elements in the cursor

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

A strict version of collect

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

each :: Cursor a -> (a -> IO b) -> IO () Source #

serverInfo :: RethinkDBHandle -> IO Datum Source #

Get information about the server