Qualifies columns used in WHERE clauses so we can use computed columns as filters

This commit is contained in:
Diogo Biazus
2015-07-10 12:35:24 -04:00
parent c0d44232a5
commit c76864a653
5 changed files with 55 additions and 32 deletions
+6
View File
@@ -266,6 +266,12 @@ spec = afterAll_ resetDb $ around withApp $ do
liftIO $ simpleHeaders g
`shouldSatisfy` matchHeader "Content-Range" "0-9/10"
it "can update based on a computed column" $
request methodPatch
"/items?always_true=eq.false"
[("Prefer", "return=representation")]
[json| { id: 100 } |]
`shouldRespondWith` 404
it "can provide a representation" $ do
_ <- post "/items"
[json| { id: 1 } |]
+4
View File
@@ -63,6 +63,10 @@ spec =
get "/tsearch?text_search_vector=@@.foo" `shouldRespondWith`
"[{\"text_search_vector\":\"'bar':2 'foo':1\"}]"
it "matches with computed column" $
get "/items?always_true=eq.true" `shouldRespondWith`
"[{\"id\":1},{\"id\":2},{\"id\":3},{\"id\":4},{\"id\":5},{\"id\":6},{\"id\":7},{\"id\":8},{\"id\":9},{\"id\":10},{\"id\":11},{\"id\":12},{\"id\":13},{\"id\":14},{\"id\":15}]"
describe "ordering response" $ do
it "by a column asc" $
get "/items?id=lte.2&order=id.asc"