postgrest-0.5.0.0: REST API for any Postgres database

Safe HaskellNone
LanguageHaskell2010

PostgREST.Types

Synopsis

Documentation

data ContentType Source #

Enumeration of currently supported response content types

data PgArg Source #

Constructors

PgArg 

Fields

Instances

Eq PgArg Source # 

Methods

(==) :: PgArg -> PgArg -> Bool #

(/=) :: PgArg -> PgArg -> Bool #

Ord PgArg Source # 

Methods

compare :: PgArg -> PgArg -> Ordering #

(<) :: PgArg -> PgArg -> Bool #

(<=) :: PgArg -> PgArg -> Bool #

(>) :: PgArg -> PgArg -> Bool #

(>=) :: PgArg -> PgArg -> Bool #

max :: PgArg -> PgArg -> PgArg #

min :: PgArg -> PgArg -> PgArg #

Show PgArg Source # 

Methods

showsPrec :: Int -> PgArg -> ShowS #

show :: PgArg -> String #

showList :: [PgArg] -> ShowS #

data Table Source #

Instances

Eq Table Source # 

Methods

(==) :: Table -> Table -> Bool #

(/=) :: Table -> Table -> Bool #

Ord Table Source # 

Methods

compare :: Table -> Table -> Ordering #

(<) :: Table -> Table -> Bool #

(<=) :: Table -> Table -> Bool #

(>) :: Table -> Table -> Bool #

(>=) :: Table -> Table -> Bool #

max :: Table -> Table -> Table #

min :: Table -> Table -> Table #

Show Table Source # 

Methods

showsPrec :: Int -> Table -> ShowS #

show :: Table -> String #

showList :: [Table] -> ShowS #

type Synonym = (Column, ViewColumn) Source #

A view column that refers to a table column

data Relation Source #

The name Relation here is used with the meaning "What is the relation between the current node and the parent node". It has nothing to do with PostgreSQL referring to tables/views as relations.

data PayloadJSON Source #

Cached attributes of a JSON payload

Constructors

PayloadJSON 

Fields

  • pjRaw :: ByteString

    This is the raw ByteString that comes from the request body. We cache this instead of an Aeson Value because it was detected that for large payloads the encoding had high memory usage, see #1005 for more details

  • pjType :: PJType
     
  • pjKeys :: Set Text

    Keys of the object or if it's an array these keys are guaranteed to be the same across all its objects

data PJType Source #

Constructors

PJArray 

Fields

PJObject 

Instances

pjIsEmpty :: PayloadJSON -> Bool Source #

e.g. whether it is []/{} or not

data Proxy Source #

Constructors

Proxy 

Instances

Eq Proxy Source # 

Methods

(==) :: Proxy -> Proxy -> Bool #

(/=) :: Proxy -> Proxy -> Bool #

Show Proxy Source # 

Methods

showsPrec :: Int -> Proxy -> ShowS #

show :: Proxy -> String #

showList :: [Proxy] -> ShowS #

data OpExpr Source #

Constructors

OpExpr Bool Operation 

Instances

type SingleVal = Text Source #

Represents a single value in a filter, e.g. id=eq.singleval

type ListVal = [Text] Source #

Represents a list value in a filter, e.g. id=in.(val1,val2,val3)

data LogicTree Source #

Boolean logic expression tree e.g. "and(name.eq.N,or(id.eq.1,id.eq.2))" is:

And / name.eq.N Or / id.eq.1 id.eq.2

type Cast = Text Source #

newtype GucHeader Source #

Custom guc header, it's obtained by parsing the json in a: `SET LOCAL "response.headers" = '[{Set-Cookie: ".."}]'

Constructors

GucHeader (Text, Text) 

type RelationDetail = Text Source #

This type will hold information about which particular Relation between two tables to choose when there are multiple ones. Specifically, it will contain the name of the foreign key or the join table in many to many relations.

type EmbedPath = [Text] Source #

Path of the embedded levels, e.g "clients.projects.name=eq.." gives Path ["clients", "projects"]

data Filter Source #

Constructors

Filter 

Fields

Instances

toHeader :: ContentType -> Header Source #

Convert from ContentType to a full HTTP Header

toMime :: ContentType -> ByteString Source #

Convert from ContentType to a ByteString representing the mime type

type JSPath = [JSPathExp] Source #

full jspath, e.g. .property[0].attr.detail

data JSPathExp Source #

jspath expression, e.g. .property, .property[0] or ."property-dash"

Constructors

JSPKey Text 
JSPIdx Int