Fix #701: allow quoted values for IN operator, refactor and Fix #641: allow IN filter to have no values (#854)

This commit is contained in:
Steve Chávez
2017-04-11 00:57:44 -05:00
committed by Joe Nelson
parent 5fffbbe381
commit 0a9d9cdded
10 changed files with 224 additions and 106 deletions
+2 -3
View File
@@ -22,9 +22,8 @@ import Data.Swagger
import PostgREST.ApiRequest (ContentType(..))
import PostgREST.Config (prettyVersion)
import PostgREST.QueryBuilder (operators)
import PostgREST.Types (Table(..), Column(..), PgArg(..),
Proxy(..), ProcDescription(..), toMime)
Proxy(..), ProcDescription(..), toMime, Operator(..))
makeMimeList :: [ContentType] -> MimeList
makeMimeList cs = MimeList $ map (fromString . toS . toMime) cs
@@ -73,7 +72,7 @@ makeOperatorPattern =
intercalate "|"
[ concat ["^", x, y, "[.]"] |
x <- ["not[.]", ""],
y <- map fst operators ]
y <- map show [Equals ..] ]
makeRowFilter :: Column -> Param
makeRowFilter c =