Close #1145, OpenAPI materialized view columns
This commit is contained in:
committed by
Steve Chávez
parent
105671e51a
commit
69a76a627f
@@ -163,6 +163,38 @@ spec = do
|
||||
]
|
||||
|]
|
||||
|
||||
describe "Materialized view" $
|
||||
|
||||
it "includes materialized view properties" $ do
|
||||
r <- simpleBody <$> get "/"
|
||||
|
||||
let method s = key "paths" . key "/materialized_projects" . key s
|
||||
summary = r ^? method "get" . key "summary"
|
||||
description = r ^? method "get" . key "description"
|
||||
parameters = r ^? method "get" . key "parameters"
|
||||
|
||||
liftIO $ do
|
||||
|
||||
summary `shouldBe` Just "A materialized view for projects"
|
||||
|
||||
description `shouldBe` Just "Just a test for materialized views"
|
||||
|
||||
parameters `shouldBe` Just
|
||||
[aesonQQ|
|
||||
[
|
||||
{ "$ref": "#/parameters/rowFilter.materialized_projects.id" },
|
||||
{ "$ref": "#/parameters/rowFilter.materialized_projects.name" },
|
||||
{ "$ref": "#/parameters/rowFilter.materialized_projects.client_id" },
|
||||
{ "$ref": "#/parameters/select" },
|
||||
{ "$ref": "#/parameters/order" },
|
||||
{ "$ref": "#/parameters/range" },
|
||||
{ "$ref": "#/parameters/rangeUnit" },
|
||||
{ "$ref": "#/parameters/offset" },
|
||||
{ "$ref": "#/parameters/limit" },
|
||||
{ "$ref": "#/parameters/preferCount" }
|
||||
]
|
||||
|]
|
||||
|
||||
describe "RPC" $ do
|
||||
|
||||
it "includes body schema for arguments" $ do
|
||||
|
||||
Vendored
+1
@@ -86,6 +86,7 @@ GRANT ALL ON TABLE
|
||||
, authors_have_book_in_decade
|
||||
, foos
|
||||
, bars
|
||||
, materialized_projects
|
||||
TO postgrest_test_anonymous;
|
||||
|
||||
GRANT INSERT ON TABLE insertonly TO postgrest_test_anonymous;
|
||||
|
||||
Vendored
+8
@@ -1536,3 +1536,11 @@ CREATE TABLE test.bar(
|
||||
|
||||
CREATE VIEW test.foos as select id,name from "Foo";
|
||||
CREATE VIEW test.bars as select id, "fooId", name from bar;
|
||||
|
||||
create materialized view materialized_projects as
|
||||
select id, name, client_id from projects;
|
||||
|
||||
comment on materialized view materialized_projects is
|
||||
$$A materialized view for projects
|
||||
|
||||
Just a test for materialized views$$;
|
||||
|
||||
Reference in New Issue
Block a user