diff --git a/src/PostgREST/DbRequestBuilder.hs b/src/PostgREST/DbRequestBuilder.hs index dcb05f3bb..3d8c34cca 100644 --- a/src/PostgREST/DbRequestBuilder.hs +++ b/src/PostgREST/DbRequestBuilder.hs @@ -1,3 +1,11 @@ +{-| +Module : PostgREST.DbRequestBuilder +Description : PostgREST database request builder + +This module is in charge of building an intermediate representation(ReadRequest, MutateRequest) between the HTTP request and the final resulting SQL query. + +A query tree is built in case of resource embedding. By inferring the relationship between tables, join conditions are added for every embedded resource. +-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DuplicateRecordFields#-} {-# LANGUAGE LambdaCase #-} diff --git a/src/PostgREST/DbStructure.hs b/src/PostgREST/DbStructure.hs index a4af0c7da..36b27a986 100644 --- a/src/PostgREST/DbStructure.hs +++ b/src/PostgREST/DbStructure.hs @@ -1,3 +1,13 @@ +{-| +Module : PostgREST.DbStructure +Description : PostgREST schema cache + +This module contains queries that target PostgreSQL system catalogs, these are used to build the schema cache(DbStructure). + +The schema cache is necessary for resource embedding, foreign keys are used for inferring the relationships between tables. + +These queries are executed once at startup or when PostgREST is reloaded. +-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE QuasiQuotes #-} diff --git a/src/PostgREST/Error.hs b/src/PostgREST/Error.hs index f54a8e638..7aee67c5f 100644 --- a/src/PostgREST/Error.hs +++ b/src/PostgREST/Error.hs @@ -1,3 +1,7 @@ +{-| +Module : PostgREST.Error +Description : PostgREST error HTTP responses +-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} diff --git a/src/PostgREST/Middleware.hs b/src/PostgREST/Middleware.hs index 76cbe2db3..80ef38454 100644 --- a/src/PostgREST/Middleware.hs +++ b/src/PostgREST/Middleware.hs @@ -1,3 +1,7 @@ +{-| +Module : PostgREST.Middleware +Description : Sets the PostgreSQL GUCs, role, search_path and pre-request function. Validates JWT. +-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} diff --git a/src/PostgREST/OpenAPI.hs b/src/PostgREST/OpenAPI.hs index e64e59807..08dd0f38d 100644 --- a/src/PostgREST/OpenAPI.hs +++ b/src/PostgREST/OpenAPI.hs @@ -1,10 +1,14 @@ +{-| +Module : PostgREST.OpenAPI +Description : Generates the OpenAPI output +-} {-# LANGUAGE OverloadedStrings #-} module PostgREST.OpenAPI ( encodeOpenAPI - , isMalformedProxyUri - , pickProxy - ) where +, isMalformedProxyUri +, pickProxy +) where import Control.Arrow ((&&&)) import Control.Lens diff --git a/src/PostgREST/Parsers.hs b/src/PostgREST/Parsers.hs index a90689183..b5e601afa 100644 --- a/src/PostgREST/Parsers.hs +++ b/src/PostgREST/Parsers.hs @@ -1,3 +1,9 @@ +{-| +Module : PostgREST.Parsers +Description : PostgREST parser combinators + +This module is in charge of parsing all the querystring values in an url, e.g. the select, id, order in `/projects?select=id,name&id=eq.1&order=id,name.desc`. +-} module PostgREST.Parsers where import Protolude hiding (try, intercalate, replace, option) diff --git a/src/PostgREST/RangeQuery.hs b/src/PostgREST/RangeQuery.hs index cd7ffc69b..4819d6d12 100644 --- a/src/PostgREST/RangeQuery.hs +++ b/src/PostgREST/RangeQuery.hs @@ -1,3 +1,7 @@ +{-| +Module : PostgREST.RangeQuery +Description : Logic regarding the `Range` header and `limit`, `offset` querystring arguments. +-} module PostgREST.RangeQuery ( rangeParse , rangeRequested diff --git a/src/PostgREST/Types.hs b/src/PostgREST/Types.hs index c36c00385..44c88e449 100644 --- a/src/PostgREST/Types.hs +++ b/src/PostgREST/Types.hs @@ -1,3 +1,7 @@ +{-| +Module : PostgREST.Types +Description : PostgREST common types and functions used by the rest of the modules +-} {-# LANGUAGE DuplicateRecordFields #-} module PostgREST.Types where import Protolude