support dash in column names fix #462

This commit is contained in:
Ruslan Talpa
2016-05-11 10:43:34 +03:00
parent 0dc33dbf9f
commit cacc725e41
5 changed files with 67 additions and 40 deletions
+5 -1
View File
@@ -143,7 +143,11 @@ spec = do
it "selectStar works in absense of parameter" $
get "/complex_items?id=eq.3" `shouldRespondWith`
[str|[{"id":3,"name":"Three","settings":{"foo":{"int":1,"bar":"baz"}},"arr_data":[1,2,3]}]|]
[str|[{"id":3,"name":"Three","settings":{"foo":{"int":1,"bar":"baz"}},"arr_data":[1,2,3],"field-with_sep":1}]|]
it "dash `-` in column names is accepted" $
get "/complex_items?id=eq.3&select=id,field-with_sep" `shouldRespondWith`
[str|[{"id":3,"field-with_sep":1}]|]
it "one simple column" $
get "/complex_items?select=id" `shouldRespondWith`
+2 -1
View File
@@ -432,7 +432,8 @@ CREATE TABLE complex_items (
id bigint NOT NULL,
name text,
settings pg_catalog.json,
arr_data integer[]
arr_data integer[],
"field-with_sep" integer default 1 not null
);