Merge remote-tracking branch 'begriffs/v3' into v3

This commit is contained in:
Ruslan Talpa
2015-10-24 21:25:01 +03:00
5 changed files with 35 additions and 25 deletions
+30 -10
View File
@@ -30,7 +30,7 @@ executable postgrest
main-is: PostgREST/Main.hs main-is: PostgREST/Main.hs
default-extensions: OverloadedStrings, ScopedTypeVariables, QuasiQuotes default-extensions: OverloadedStrings, ScopedTypeVariables, QuasiQuotes
default-language: Haskell2010 default-language: Haskell2010
build-depends: base >=4.6 && <5 build-depends: base >= 4.8 && < 5
, postgrest , postgrest
, hasql >= 0.7.3 && < 0.8 , hasql >= 0.7.3 && < 0.8
, hasql-backend >= 0.4.1 && < 0.5 , hasql-backend >= 0.4.1 && < 0.5
@@ -62,6 +62,18 @@ executable postgrest
, errors , errors
, bifunctors , bifunctors
hs-source-dirs: src hs-source-dirs: src
other-modules: Paths_postgrest
, PostgREST.App
, PostgREST.Auth
, PostgREST.Config
, PostgREST.Error
, PostgREST.Middleware
, PostgREST.Parsers
, PostgREST.PgQuery
, PostgREST.PgStructure
, PostgREST.QueryBuilder
, PostgREST.RangeQuery
, PostgREST.Types
library library
if flag(ci) if flag(ci)
@@ -116,16 +128,16 @@ library
Other-Modules: Paths_postgrest Other-Modules: Paths_postgrest
Exposed-Modules: PostgREST.App Exposed-Modules: PostgREST.App
, PostgREST.Types
, PostgREST.Parsers
, PostgREST.QueryBuilder
, PostgREST.Auth , PostgREST.Auth
, PostgREST.Config , PostgREST.Config
, PostgREST.Error , PostgREST.Error
, PostgREST.Middleware , PostgREST.Middleware
, PostgREST.Parsers
, PostgREST.PgQuery , PostgREST.PgQuery
, PostgREST.PgStructure , PostgREST.PgStructure
, PostgREST.QueryBuilder
, PostgREST.RangeQuery , PostgREST.RangeQuery
, PostgREST.Types
hs-source-dirs: src hs-source-dirs: src
Test-Suite spec Test-Suite spec
@@ -138,21 +150,29 @@ Test-Suite spec
else else
ghc-options: -Wall -W -O2 ghc-options: -Wall -W -O2
Main-Is: Main.hs Main-Is: Main.hs
Other-Modules: PostgREST.App Other-Modules: Feature.AuthSpec
, PostgREST.Types , Feature.CorsSpec
, PostgREST.Parsers , Feature.DeleteSpec
, PostgREST.QueryBuilder , Feature.InsertSpec
, Feature.QuerySpec
, Feature.RangeSpec
, Feature.StructureSpec
, Paths_postgrest
, PostgREST.App
, PostgREST.Auth , PostgREST.Auth
, PostgREST.Config , PostgREST.Config
, PostgREST.Error , PostgREST.Error
, PostgREST.Middleware , PostgREST.Middleware
, PostgREST.Parsers
, PostgREST.PgQuery , PostgREST.PgQuery
, PostgREST.PgStructure , PostgREST.PgStructure
, PostgREST.QueryBuilder
, PostgREST.RangeQuery , PostgREST.RangeQuery
, PostgREST.Types
, Spec , Spec
, SpecHelper , SpecHelper
, Paths_postgrest , TestTypes
Build-Depends: base, hspec == 2.1.*, QuickCheck Build-Depends: base, hspec == 2.2.*, QuickCheck
, hspec-wai, hspec-wai-json , hspec-wai, hspec-wai-json
, hasql, hasql-backend , hasql, hasql-backend
, hasql-postgres , hasql-postgres
+1 -1
View File
@@ -399,7 +399,7 @@ convertJson v = (,) <$> (header <$> normalized) <*> (vals <$> normalized)
normalized = groupByKey =<< normalizeValue v normalized = groupByKey =<< normalizeValue v
vals :: [(Text, [Value])] -> [[Value]] vals :: [(Text, [Value])] -> [[Value]]
vals a = transpose $ map snd a vals = transpose . map snd
header :: [(Text, [Value])] -> [Text] header :: [(Text, [Value])] -> [Text]
header = map fst header = map fst
+1 -4
View File
@@ -12,15 +12,12 @@ In the test suite there is an example of simple login function that can be used
very simple authentication system inside the PostgreSQL database. very simple authentication system inside the PostgreSQL database.
-} -}
module PostgREST.Auth ( module PostgREST.Auth (
setRole setRole
, claimsToSQL , claimsToSQL
, jwtClaims , jwtClaims
, tokenJWT , tokenJWT
) where ) where
--line needed for ghc 7.8
--import Data.Functor ((<$>))
import Data.Aeson (Value (..), Object) import Data.Aeson (Value (..), Object)
import Data.Aeson.Types (emptyObject, emptyArray) import Data.Aeson.Types (emptyObject, emptyArray)
import Data.Vector as V (null, head) import Data.Vector as V (null, head)
-3
View File
@@ -3,9 +3,6 @@
module PostgREST.Middleware where module PostgREST.Middleware where
-- needed for ghc 7.8
-- import Data.Functor ((<$>))
import Data.Maybe (fromMaybe, isNothing) import Data.Maybe (fromMaybe, isNothing)
import Data.Monoid import Data.Monoid
import Data.Text import Data.Text
+3 -7
View File
@@ -4,13 +4,9 @@ module PostgREST.Parsers
where where
import Control.Applicative hiding ((<$>)) import Control.Applicative hiding ((<$>))
--lines needed for ghc 7.8 import Control.Monad (join)
-- import Data.Functor ((<$>)) import Data.List (delete, find)
-- import Data.Traversable (traverse) import Data.Maybe
--import Control.Monad (join)
--import Data.List (delete, find)
--import Data.Maybe
import Data.Monoid import Data.Monoid
import Data.String.Conversions (cs) import Data.String.Conversions (cs)
import Data.Text (Text) import Data.Text (Text)