rethinkdb-1.15.1.0: A driver for RethinkDB 1.15

Safe HaskellNone

Database.RethinkDB.ReQL

Description

Building RQL queries in Haskell

Synopsis

Documentation

data ReQL

A ReQL Term

Constructors

ReQL 

Fields

runReQL :: State QuerySettings Term
 

Instances

Floating ReQL 
Fractional ReQL 
Num ReQL 
Show ReQL 
IsString ReQL 
Expr ReQL 
OptArgs ReQL 
(~ * a ReQL, ~ * b ReQL) => Expr (a -> b -> ReQL) 
~ * a ReQL => Expr (a -> ReQL) 

op :: Arr a => TermType -> a -> ReQL

Build a term with no optargs

op' :: Arr a => TermType -> a -> [Attribute Static] -> ReQL

Build a term

data Term

Internal representation of a ReQL Term

Constructors

Term 
Datum 

Fields

termDatum :: Datum
 
Note 

Fields

termNote :: String
 
termTerm :: Term
 

Instances

buildQuery :: ReQL -> Int64 -> Database -> [(Text, Datum)] -> (WireQuery, Term)

type Backtrace = [Frame]

data Frame

Constructors

FramePos Int 
FrameOpt Text 

class Expr e where

Convert other types into ReQL expressions

Methods

expr :: e -> ReQL

exprList :: [e] -> ReQL

Instances

Expr Bool 
Expr Char 
Expr Double 
Expr Float 
Expr Int 
Expr Int8 
Expr Int16 
Expr Int32 
Expr Int64 
Expr Integer 
Expr Word 
Expr Word8 
Expr Word16 
Expr Word32 
Expr Word64 
Expr () 
Expr ByteString 
Expr ByteString 
Expr ZonedTime 
Expr UTCTime 
Expr Value 
Expr Text 
Expr Text 
Expr Datum 
Expr Table 
Expr Database 
Expr ReQL 
Expr Term 
Expr Unit 
Expr ConflictResolution 
Expr Durability 
Expr PaginationStrategy 
Expr HttpMethod 
Expr HttpResultFormat 
Expr a => Expr [a] 
Expr (Ratio Integer) 
Expr a => Expr (Maybe a) 
Expr a => Expr (Set a) 
Expr a => Expr (Vector a) 
Expr (Attribute a) 
(~ * a ReQL, ~ * b ReQL) => Expr (a -> b -> ReQL) 
~ * a ReQL => Expr (a -> ReQL) 
(Expr a, Expr b) => Expr (Either a b) 
(Expr a, Expr b) => Expr (a, b) 
Expr a => Expr (Map [Char] a) 
Expr a => Expr (Map Text a) 
Expr a => Expr (HashMap [Char] a) 
(Expr k, Expr v) => Expr (HashMap k v) 
Expr a => Expr (HashMap Text a) 
(Expr a, Expr b, Expr c) => Expr (a, b, c) 
(Expr a, Expr b, Expr c, Expr d) => Expr (a, b, c, d) 
(Expr a, Expr b, Expr c, Expr d, Expr e) => Expr (a, b, c, d, e) 

data QuerySettings

State used to build a Term

Instances

Default QuerySettings 

str :: String -> ReQL

A shortcut for inserting strings into ReQL expressions Useful when OverloadedStrings makes the type ambiguous

num :: Double -> ReQL

A shortcut for inserting numbers into ReQL expressions

data Attribute a where

A key/value pair used for building objects

Constructors

:= :: Expr e => Text -> e -> Attribute a 
::= :: (Expr k, Expr v) => k -> v -> Attribute Dynamic 
NoAttribute :: Attribute a 

Instances

data Static

data Dynamic

class OptArgs a where

An operation that accepts optional arguments

Methods

ex :: a -> [Attribute Static] -> a

Extend an operation with optional arguments

Instances

OptArgs ReQL 
OptArgs b => OptArgs (a -> b) 

cons :: Expr e => e -> ArgList -> ArgList

arr :: Arr a => a -> ArgList

baseArray :: ArgList -> State QuerySettings [Term]

data Bound a

An upper or lower bound for between and during

Constructors

Open

An inclusive bound

Fields

getBound :: a
 
Closed

An exclusive bound

Fields

getBound :: a
 
DefaultBound 

Fields

getBound :: a
 

Instances

Functor Bound 
Num a => Num (Bound a) 

closedOrOpen :: Bound a -> Maybe Text

datumTerm :: ToDatum a => a -> ReQL

empty :: ReQL

An empty object

newtype WireQuery

Constructors

WireQuery 

Fields

queryJSON :: Datum
 

Instances

newtype WireBacktrace

Constructors

WireBacktrace 

Fields

backtraceJSON :: Datum
 

note :: String -> ReQL -> ReQL

Add a note a a ReQL Term

This note does not get sent to the server. It is used to annotate backtraces and help debugging.

(?:=) :: Expr e => Text -> Maybe e -> Attribute a