postgrest-7.0.1: REST API for any Postgres database

Safe HaskellNone
LanguageHaskell2010

PostgREST.ApiRequest

Description

 
Synopsis

Documentation

data ApiRequest Source #

Describes what the user wants to do. This data type is a translation of the raw elements of an HTTP request into domain specific language. There is no guarantee that the intent is sensible, it is up to a later stage of processing to determine if it is an action we are able to perform.

Constructors

ApiRequest 

Fields

data InvokeMethod Source #

Constructors

InvHead 
InvGet 
InvPost 
Instances
Eq InvokeMethod Source # 
Instance details

Defined in PostgREST.ApiRequest

data ContentType Source #

Enumeration of currently supported response content types

Instances
Eq ContentType Source # 
Instance details

Defined in PostgREST.Types

Show ContentType Source # 
Instance details

Defined in PostgREST.Types

data Action Source #

Types of things a user wants to do to tablesviewsprocs

Instances
Eq Action Source # 
Instance details

Defined in PostgREST.ApiRequest

Methods

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

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

data Target Source #

The target db object of a user action

Instances
Eq Target Source # 
Instance details

Defined in PostgREST.ApiRequest

Methods

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

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

mutuallyAgreeable :: [ContentType] -> [ContentType] -> Maybe ContentType Source #

Find the best match from a list of content types accepted by the client in order of decreasing preference and a list of types producible by the server. If there is no match but the client accepts */* then return the top server pick.

userApiRequest :: NonEmpty Schema -> Maybe Text -> Request -> RequestBody -> Either ApiRequestError ApiRequest Source #

Examines HTTP request and translates it into user intent.