-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | REST API for any Postgres database
--   
--   Reads the schema of a PostgreSQL database and creates RESTful routes
--   for the tables and views, supporting all HTTP verbs that security
--   permits.
@package postgrest
@version 0.4.2.0

module PostgREST.RangeQuery
rangeParse :: ByteString -> NonnegRange
rangeRequested :: RequestHeaders -> NonnegRange
rangeLimit :: NonnegRange -> Maybe Integer
rangeOffset :: NonnegRange -> Integer
restrictRange :: Maybe Integer -> NonnegRange -> NonnegRange
rangeGeq :: Integer -> NonnegRange
allRange :: NonnegRange
type NonnegRange = Range Integer

module PostgREST.Types

-- | Enumeration of currently supported response content types
data ContentType
CTApplicationJSON :: ContentType
CTTextCSV :: ContentType
CTOpenAPI :: ContentType
CTSingularJSON :: ContentType
CTOctetStream :: ContentType
CTAny :: ContentType
CTOther :: ByteString -> ContentType
data ApiRequestError
ActionInappropriate :: ApiRequestError
InvalidBody :: ByteString -> ApiRequestError
InvalidRange :: ApiRequestError
ParseRequestError :: Text -> Text -> ApiRequestError
UnknownRelation :: ApiRequestError
NoRelationBetween :: Text -> Text -> ApiRequestError
UnsupportedVerb :: ApiRequestError
data DbStructure
DbStructure :: [Table] -> [Column] -> [Relation] -> [PrimaryKey] -> HashMap Text ProcDescription -> DbStructure
[$sel:dbTables:DbStructure] :: DbStructure -> [Table]
[$sel:dbColumns:DbStructure] :: DbStructure -> [Column]
[$sel:dbRelations:DbStructure] :: DbStructure -> [Relation]
[$sel:dbPrimaryKeys:DbStructure] :: DbStructure -> [PrimaryKey]
[$sel:dbProcs:DbStructure] :: DbStructure -> HashMap Text ProcDescription
data PgArg
PgArg :: Text -> Text -> Bool -> PgArg
[$sel:pgaName:PgArg] :: PgArg -> Text
[$sel:pgaType:PgArg] :: PgArg -> Text
[$sel:pgaReq:PgArg] :: PgArg -> Bool
data PgType
Scalar :: QualifiedIdentifier -> PgType
Composite :: QualifiedIdentifier -> PgType
Pseudo :: Text -> PgType
data RetType
Single :: PgType -> RetType
SetOf :: PgType -> RetType
data ProcVolatility
Volatile :: ProcVolatility
Stable :: ProcVolatility
Immutable :: ProcVolatility
data ProcDescription
ProcDescription :: Text -> [PgArg] -> RetType -> ProcVolatility -> ProcDescription
[$sel:pdName:ProcDescription] :: ProcDescription -> Text
[$sel:pdArgs:ProcDescription] :: ProcDescription -> [PgArg]
[$sel:pdReturnType:ProcDescription] :: ProcDescription -> RetType
[$sel:pdVolatility:ProcDescription] :: ProcDescription -> ProcVolatility
type Schema = Text
type TableName = Text
type SqlQuery = Text
type SqlFragment = Text
type RequestBody = ByteString
data Table
Table :: Schema -> TableName -> Bool -> Table
[$sel:tableSchema:Table] :: Table -> Schema
[$sel:tableName:Table] :: Table -> TableName
[$sel:tableInsertable:Table] :: Table -> Bool
newtype ForeignKey
ForeignKey :: Column -> ForeignKey
[$sel:fkCol:ForeignKey] :: ForeignKey -> Column
data Column
Column :: Table -> Text -> Int32 -> Bool -> Text -> Bool -> Maybe Int32 -> Maybe Int32 -> Maybe Text -> [Text] -> Maybe ForeignKey -> Column
[$sel:colTable:Column] :: Column -> Table
[$sel:colName:Column] :: Column -> Text
[$sel:colPosition:Column] :: Column -> Int32
[$sel:colNullable:Column] :: Column -> Bool
[$sel:colType:Column] :: Column -> Text
[$sel:colUpdatable:Column] :: Column -> Bool
[$sel:colMaxLen:Column] :: Column -> Maybe Int32
[$sel:colPrecision:Column] :: Column -> Maybe Int32
[$sel:colDefault:Column] :: Column -> Maybe Text
[$sel:colEnum:Column] :: Column -> [Text]
[$sel:colFK:Column] :: Column -> Maybe ForeignKey
type Synonym = (Column, Column)
data PrimaryKey
PrimaryKey :: Table -> Text -> PrimaryKey
[$sel:pkTable:PrimaryKey] :: PrimaryKey -> Table
[$sel:pkName:PrimaryKey] :: PrimaryKey -> Text
data OrderDirection
OrderAsc :: OrderDirection
OrderDesc :: OrderDirection
data OrderNulls
OrderNullsFirst :: OrderNulls
OrderNullsLast :: OrderNulls
data OrderTerm
OrderTerm :: Field -> Maybe OrderDirection -> Maybe OrderNulls -> OrderTerm
[$sel:otTerm:OrderTerm] :: OrderTerm -> Field
[$sel:otDirection:OrderTerm] :: OrderTerm -> Maybe OrderDirection
[$sel:otNullOrder:OrderTerm] :: OrderTerm -> Maybe OrderNulls
data QualifiedIdentifier
QualifiedIdentifier :: Schema -> TableName -> QualifiedIdentifier
[$sel:qiSchema:QualifiedIdentifier] :: QualifiedIdentifier -> Schema
[$sel:qiName:QualifiedIdentifier] :: QualifiedIdentifier -> TableName
data RelationType
Child :: RelationType
Parent :: RelationType
Many :: RelationType
Root :: RelationType
data Relation
Relation :: Table -> [Column] -> Table -> [Column] -> RelationType -> Maybe Table -> Maybe [Column] -> Maybe [Column] -> Relation
[$sel:relTable:Relation] :: Relation -> Table
[$sel:relColumns:Relation] :: Relation -> [Column]
[$sel:relFTable:Relation] :: Relation -> Table
[$sel:relFColumns:Relation] :: Relation -> [Column]
[$sel:relType:Relation] :: Relation -> RelationType
[$sel:relLTable:Relation] :: Relation -> Maybe Table
[$sel:relLCols1:Relation] :: Relation -> Maybe [Column]
[$sel:relLCols2:Relation] :: Relation -> Maybe [Column]

-- | An array of JSON objects that has been verified to have the same keys
--   in every object
newtype PayloadJSON
PayloadJSON :: (Vector Object) -> PayloadJSON
unPayloadJSON :: PayloadJSON -> Vector Object
data Proxy
Proxy :: Text -> Text -> Integer -> Text -> Proxy
[$sel:proxyScheme:Proxy] :: Proxy -> Text
[$sel:proxyHost:Proxy] :: Proxy -> Text
[$sel:proxyPort:Proxy] :: Proxy -> Integer
[$sel:proxyPath:Proxy] :: Proxy -> Text
type Operator = Text
operators :: HashMap Operator SqlFragment
data Operation
Operation :: Bool -> (Operator, Operand) -> Operation
[$sel:hasNot:Operation] :: Operation -> Bool
[$sel:expr:Operation] :: Operation -> (Operator, Operand)
data Operand
VText :: Text -> Operand
VTextL :: [Text] -> Operand
VForeignKey :: QualifiedIdentifier -> ForeignKey -> Operand
data LogicOperator
And :: LogicOperator
Or :: LogicOperator

-- | 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
data LogicTree
Expr :: Bool -> LogicOperator -> LogicTree -> LogicTree -> LogicTree
Stmnt :: Filter -> LogicTree
type FieldName = Text
type JsonPath = [Text]
type Field = (FieldName, Maybe JsonPath)
type Alias = Text
type Cast = Text
type NodeName = Text
type SelectItem = (Field, Maybe Cast, Maybe Alias)

-- | Path of the embedded levels, e.g "clients.projects.name=eq.." gives
--   Path ["clients", "projects"]
type EmbedPath = [Text]
data Filter
Filter :: Field -> Operation -> Filter
[$sel:field:Filter] :: Filter -> Field
[$sel:operation:Filter] :: Filter -> Operation
data ReadQuery
Select :: [SelectItem] -> [TableName] -> [Filter] -> [LogicTree] -> Maybe [OrderTerm] -> NonnegRange -> ReadQuery
[$sel:select:Select] :: ReadQuery -> [SelectItem]
[$sel:from:Select] :: ReadQuery -> [TableName]
[$sel:flt_:Select] :: ReadQuery -> [Filter]
[$sel:logic:Select] :: ReadQuery -> [LogicTree]
[$sel:order:Select] :: ReadQuery -> Maybe [OrderTerm]
[$sel:range_:Select] :: ReadQuery -> NonnegRange
data MutateQuery
Insert :: TableName -> PayloadJSON -> [FieldName] -> MutateQuery
[$sel:in_:Insert] :: MutateQuery -> TableName
[$sel:qPayload:Insert] :: MutateQuery -> PayloadJSON
[$sel:returning:Insert] :: MutateQuery -> [FieldName]
Delete :: TableName -> [Filter] -> [LogicTree] -> [FieldName] -> MutateQuery
[$sel:in_:Insert] :: MutateQuery -> TableName
[$sel:where_:Insert] :: MutateQuery -> [Filter]
[$sel:logic:Insert] :: MutateQuery -> [LogicTree]
[$sel:returning:Insert] :: MutateQuery -> [FieldName]
Update :: TableName -> PayloadJSON -> [Filter] -> [LogicTree] -> [FieldName] -> MutateQuery
[$sel:in_:Insert] :: MutateQuery -> TableName
[$sel:qPayload:Insert] :: MutateQuery -> PayloadJSON
[$sel:where_:Insert] :: MutateQuery -> [Filter]
[$sel:logic:Insert] :: MutateQuery -> [LogicTree]
[$sel:returning:Insert] :: MutateQuery -> [FieldName]
type ReadNode = (ReadQuery, (NodeName, Maybe Relation, Maybe Alias))
type ReadRequest = Tree ReadNode
type MutateRequest = MutateQuery
data DbRequest
DbRead :: ReadRequest -> DbRequest
DbMutate :: MutateRequest -> DbRequest

-- | Convert from ContentType to a full HTTP Header
toHeader :: ContentType -> Header

-- | Convert from ContentType to a ByteString representing the mime type
toMime :: ContentType -> ByteString
instance GHC.Classes.Eq PostgREST.Types.MutateQuery
instance GHC.Show.Show PostgREST.Types.MutateQuery
instance GHC.Classes.Eq PostgREST.Types.ReadQuery
instance GHC.Show.Show PostgREST.Types.ReadQuery
instance GHC.Classes.Eq PostgREST.Types.LogicTree
instance GHC.Show.Show PostgREST.Types.LogicTree
instance GHC.Classes.Eq PostgREST.Types.Filter
instance GHC.Show.Show PostgREST.Types.Filter
instance GHC.Classes.Eq PostgREST.Types.OrderTerm
instance GHC.Show.Show PostgREST.Types.OrderTerm
instance GHC.Classes.Eq PostgREST.Types.LogicOperator
instance GHC.Show.Show PostgREST.Types.Operation
instance GHC.Classes.Eq PostgREST.Types.Operation
instance GHC.Classes.Eq PostgREST.Types.Operand
instance GHC.Show.Show PostgREST.Types.Operand
instance GHC.Classes.Eq PostgREST.Types.Proxy
instance GHC.Show.Show PostgREST.Types.Proxy
instance GHC.Classes.Eq PostgREST.Types.PayloadJSON
instance GHC.Show.Show PostgREST.Types.PayloadJSON
instance GHC.Classes.Eq PostgREST.Types.DbStructure
instance GHC.Show.Show PostgREST.Types.DbStructure
instance GHC.Classes.Eq PostgREST.Types.Relation
instance GHC.Show.Show PostgREST.Types.Relation
instance GHC.Classes.Eq PostgREST.Types.RelationType
instance GHC.Show.Show PostgREST.Types.RelationType
instance GHC.Classes.Eq PostgREST.Types.ProcDescription
instance GHC.Show.Show PostgREST.Types.ProcDescription
instance GHC.Show.Show PostgREST.Types.RetType
instance GHC.Classes.Eq PostgREST.Types.RetType
instance GHC.Show.Show PostgREST.Types.PgType
instance GHC.Classes.Eq PostgREST.Types.PgType
instance GHC.Classes.Eq PostgREST.Types.QualifiedIdentifier
instance GHC.Show.Show PostgREST.Types.QualifiedIdentifier
instance GHC.Classes.Eq PostgREST.Types.OrderNulls
instance GHC.Classes.Eq PostgREST.Types.OrderDirection
instance GHC.Classes.Eq PostgREST.Types.PrimaryKey
instance GHC.Show.Show PostgREST.Types.PrimaryKey
instance GHC.Classes.Ord PostgREST.Types.ForeignKey
instance GHC.Classes.Eq PostgREST.Types.ForeignKey
instance GHC.Show.Show PostgREST.Types.ForeignKey
instance GHC.Classes.Ord PostgREST.Types.Column
instance GHC.Show.Show PostgREST.Types.Column
instance GHC.Classes.Ord PostgREST.Types.Table
instance GHC.Show.Show PostgREST.Types.Table
instance GHC.Show.Show PostgREST.Types.ProcVolatility
instance GHC.Classes.Eq PostgREST.Types.ProcVolatility
instance GHC.Classes.Eq PostgREST.Types.PgArg
instance GHC.Show.Show PostgREST.Types.PgArg
instance GHC.Classes.Eq PostgREST.Types.ApiRequestError
instance GHC.Show.Show PostgREST.Types.ApiRequestError
instance GHC.Classes.Eq PostgREST.Types.ContentType
instance GHC.Show.Show PostgREST.Types.OrderDirection
instance GHC.Show.Show PostgREST.Types.OrderNulls
instance GHC.Show.Show PostgREST.Types.LogicOperator
instance Data.Aeson.Types.ToJSON.ToJSON PostgREST.Types.Column
instance Data.Aeson.Types.ToJSON.ToJSON PostgREST.Types.ForeignKey
instance Data.Aeson.Types.ToJSON.ToJSON PostgREST.Types.Table
instance GHC.Classes.Eq PostgREST.Types.Table
instance GHC.Classes.Eq PostgREST.Types.Column

module PostgREST.Parsers
pRequestSelect :: Text -> Text -> Either ApiRequestError ReadRequest
pRequestFilter :: (Text, Text) -> Either ApiRequestError (EmbedPath, Filter)
pRequestOrder :: (Text, Text) -> Either ApiRequestError (EmbedPath, [OrderTerm])
pRequestRange :: (ByteString, NonnegRange) -> Either ApiRequestError (EmbedPath, NonnegRange)
pRequestLogicTree :: (Text, Text) -> Either ApiRequestError (EmbedPath, LogicTree)
ws :: Parser Text
lexeme :: Parser a -> Parser a
pReadRequest :: Text -> Parser ReadRequest
pTreePath :: Parser (EmbedPath, Field)
pFieldForest :: Parser [Tree SelectItem]
pFieldTree :: Parser (Tree SelectItem)
pStar :: Parser Text
pFieldName :: Parser Text
pJsonPathStep :: Parser Text
pJsonPath :: Parser [Text]
pField :: Parser Field
aliasSeparator :: Parser ()
pSimpleSelect :: Parser SelectItem
pSelect :: Parser SelectItem
pOperation :: Parser Operand -> Parser Operand -> Parser Operation
pVText :: Parser Operand
pVTextL :: Parser Operand
pVTextLElement :: Parser Text
pQuotedValue :: Parser Text
pDelimiter :: Parser Char
pOrder :: Parser [OrderTerm]
pOrderTerm :: Parser OrderTerm
pLogicTree :: Parser LogicTree
pLogicVText :: Parser Operand
pLogicVTextL :: Parser Operand
pLogicPath :: Parser (EmbedPath, Text)
mapError :: Either ParseError a -> Either ApiRequestError a

module PostgREST.Error
apiRequestError :: ApiRequestError -> Response
pgError :: Bool -> UsageError -> Response
simpleError :: Status -> Text -> Response
singularityError :: Integer -> Response
binaryFieldError :: Response
connectionLostError :: Response
encodeError :: ToJSON a => a -> LByteString
instance Data.Aeson.Types.ToJSON.ToJSON PostgREST.Types.ApiRequestError
instance Data.Aeson.Types.ToJSON.ToJSON Hasql.Pool.UsageError
instance Data.Aeson.Types.ToJSON.ToJSON Hasql.Private.Session.Error

module PostgREST.DbStructure
getDbStructure :: Schema -> Session DbStructure
accessibleTables :: Query Schema [Table]


-- | This module provides functions to deal with the JWT authorization
--   (http://jwt.io). It also can be used to define other authorization
--   functions, in the future Oauth, LDAP and similar integrations can be
--   coded here.
--   
--   Authentication should always be implemented in an external service. In
--   the test suite there is an example of simple login function that can
--   be used for a very simple authentication system inside the PostgreSQL
--   database.
module PostgREST.Auth

-- | Whether a response from jwtClaims contains a role claim
containsRole :: JWTAttempt -> Bool

-- | Receives the JWT secret (from config) and a JWT and returns a map of
--   JWT claims.
jwtClaims :: Maybe Secret -> Text -> NominalDiffTime -> JWTAttempt

-- | Receives the JWT secret (from config) and a JWT and a JSON value and
--   returns a signed JWT.
tokenJWT :: Secret -> Value -> Text

-- | Possible situations encountered with client JWTs
data JWTAttempt
JWTExpired :: JWTAttempt
JWTInvalid :: JWTAttempt
JWTMissingSecret :: JWTAttempt
JWTClaims :: (HashMap Text Value) -> JWTAttempt
instance GHC.Classes.Eq PostgREST.Auth.JWTAttempt


module PostgREST.ApiRequest

-- | 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.
data ApiRequest
ApiRequest :: Action -> HashMap ByteString NonnegRange -> Target -> [ContentType] -> Maybe PayloadJSON -> PreferRepresentation -> Bool -> Bool -> [(Text, Text)] -> [(Text, Text)] -> Text -> [(Text, Text)] -> ByteString -> Text -> [(Text, Text)] -> [(Text, Text)] -> ApiRequest

-- | Similar but not identical to HTTP verb, e.g. Create/Invoke both POST
[iAction] :: ApiRequest -> Action

-- | Requested range of rows within response
[iRange] :: ApiRequest -> HashMap ByteString NonnegRange

-- | The target, be it calling a proc or accessing a table
[iTarget] :: ApiRequest -> Target

-- | Content types the client will accept, [CTAny] if no Accept header
[iAccepts] :: ApiRequest -> [ContentType]

-- | Data sent by client and used for mutation actions
[iPayload] :: ApiRequest -> Maybe PayloadJSON

-- | If client wants created items echoed back
[iPreferRepresentation] :: ApiRequest -> PreferRepresentation

-- | Pass all parameters as a single json object to a stored procedure
[iPreferSingleObjectParameter] :: ApiRequest -> Bool

-- | Whether the client wants a result count (slower)
[iPreferCount] :: ApiRequest -> Bool

-- | Filters on the result ("id", "eq.10")
[iFilters] :: ApiRequest -> [(Text, Text)]

-- | &amp;and and &amp;or parameters used for complex boolean logic
[iLogic] :: ApiRequest -> [(Text, Text)]

-- | &amp;select parameter used to shape the response
[iSelect] :: ApiRequest -> Text

-- | &amp;order parameters for each level
[iOrder] :: ApiRequest -> [(Text, Text)]

-- | Alphabetized (canonical) request query string for response URLs
[iCanonicalQS] :: ApiRequest -> ByteString

-- | JSON Web Token
[iJWT] :: ApiRequest -> Text

-- | HTTP request headers
[iHeaders] :: ApiRequest -> [(Text, Text)]

-- | Request Cookies
[iCookies] :: ApiRequest -> [(Text, Text)]

-- | Enumeration of currently supported response content types
data ContentType
CTApplicationJSON :: ContentType
CTTextCSV :: ContentType
CTOpenAPI :: ContentType
CTSingularJSON :: ContentType
CTOctetStream :: ContentType
CTAny :: ContentType
CTOther :: ByteString -> ContentType

-- | Types of things a user wants to do to tables<i>views</i>procs
data Action
ActionCreate :: Action
ActionRead :: Action
ActionUpdate :: Action
ActionDelete :: Action
ActionInfo :: Action
ActionInvoke :: Action
ActionInspect :: Action

-- | The target db object of a user action
data Target
TargetIdent :: QualifiedIdentifier -> Target
TargetProc :: QualifiedIdentifier -> Target
TargetRoot :: Target
TargetUnknown :: [Text] -> Target

-- | How to return the inserted data
data PreferRepresentation
Full :: PreferRepresentation
HeadersOnly :: PreferRepresentation
None :: PreferRepresentation

-- | 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.
mutuallyAgreeable :: [ContentType] -> [ContentType] -> Maybe ContentType

-- | Examines HTTP request and translates it into user intent.
userApiRequest :: Schema -> Request -> RequestBody -> Either ApiRequestError ApiRequest
instance GHC.Classes.Eq PostgREST.ApiRequest.PreferRepresentation
instance GHC.Classes.Eq PostgREST.ApiRequest.Target
instance GHC.Classes.Eq PostgREST.ApiRequest.Action


-- | This module provides functions to consume data types that represent
--   database objects (e.g. Relation, Schema, SqlQuery) and produces SQL
--   Statements.
--   
--   Any function that outputs a SQL fragment should be in this module.
module PostgREST.QueryBuilder
callProc :: QualifiedIdentifier -> Object -> SqlQuery -> SqlQuery -> NonnegRange -> Bool -> Bool -> Bool -> Bool -> Query () (Maybe ProcResults)
createReadStatement :: SqlQuery -> SqlQuery -> Bool -> Bool -> Bool -> Maybe FieldName -> Query () ResultsWithCount
createWriteStatement :: SqlQuery -> SqlQuery -> Bool -> Bool -> Bool -> PreferRepresentation -> [Text] -> Query PayloadJSON (Maybe ResultsWithCount)
getJoinConditions :: Relation -> [Filter]
pgFmtIdent :: SqlFragment -> SqlFragment
pgFmtLit :: SqlFragment -> SqlFragment
requestToQuery :: Schema -> Bool -> DbRequest -> SqlQuery
requestToCountQuery :: Schema -> DbRequest -> SqlQuery
sourceCTEName :: SqlFragment
unquoted :: Value -> Text

-- | The generic query result format used by API responses. The location
--   header is represented as a list of strings containing variable
--   bindings like <tt>"k1=eq.42"</tt>, or the empty list if there is no
--   location header.
type ResultsWithCount = (Maybe Int64, Int64, [ByteString], ByteString)
pgFmtEnvVar :: Text -> (Text, Text) -> SqlFragment

module PostgREST.DbRequestBuilder
readRequest :: Maybe Integer -> [Relation] -> HashMap Text ProcDescription -> ApiRequest -> Either Response ReadRequest
mutateRequest :: ApiRequest -> [FieldName] -> Either Response MutateRequest
fieldNames :: ReadRequest -> [FieldName]


-- | This module provides a helper function to read the command line
--   arguments using the optparse-applicative and the AppConfig type to
--   store them. It also can be used to define other middleware
--   configuration that may be delegated to some sort of external
--   configuration.
--   
--   It currently includes a hardcoded CORS policy but this could easly be
--   turned in configurable behaviour if needed.
--   
--   Other hardcoded options such as the minimum version number also belong
--   here.
module PostgREST.Config

-- | User friendly version number
prettyVersion :: Text

-- | Function to read and parse options from the command line
readOptions :: IO AppConfig

-- | CORS policy to be used in by Wai Cors middleware
corsPolicy :: Request -> Maybe CorsResourcePolicy

-- | Tells the minimum PostgreSQL version required by this version of
--   PostgREST
minimumPgVersion :: PgVersion
data PgVersion
PgVersion :: Int32 -> Text -> PgVersion
[pgvNum] :: PgVersion -> Int32
[pgvName] :: PgVersion -> Text

-- | Config file settings for the server
data AppConfig
AppConfig :: Text -> Text -> Maybe Text -> Text -> Text -> Int -> Maybe ByteString -> Bool -> Int -> Maybe Integer -> Maybe Text -> Bool -> AppConfig
[configDatabase] :: AppConfig -> Text
[configAnonRole] :: AppConfig -> Text
[configProxyUri] :: AppConfig -> Maybe Text
[configSchema] :: AppConfig -> Text
[configHost] :: AppConfig -> Text
[configPort] :: AppConfig -> Int
[configJwtSecret] :: AppConfig -> Maybe ByteString
[configJwtSecretIsBase64] :: AppConfig -> Bool
[configPool] :: AppConfig -> Int
[configMaxRows] :: AppConfig -> Maybe Integer
[configReqCheck] :: AppConfig -> Maybe Text
[configQuiet] :: AppConfig -> Bool

module PostgREST.Middleware
runWithClaims :: AppConfig -> JWTAttempt -> (ApiRequest -> Transaction Response) -> ApiRequest -> Transaction Response
defaultMiddle :: Application -> Application

module PostgREST.OpenAPI
encodeOpenAPI :: [ProcDescription] -> [(Table, [Column], [Text])] -> (Text, Text, Integer, Text) -> LByteString

-- | Test whether a proxy uri is malformed or not. A valid proxy uri should
--   be an absolute uri without query and user info, only http(s) schemes
--   are valid, port number range is 1-65535.
--   
--   For example <a>http://postgrest.com/openapi.json</a>
--   <a>https://postgrest.com:8080/openapi.json</a>
isMalformedProxyUri :: Maybe Text -> Bool
pickProxy :: Maybe Text -> Maybe Proxy

module PostgREST.App
postgrest :: AppConfig -> IORef (Maybe DbStructure) -> Pool -> IO POSIXTime -> IO () -> Application
