nix: add postgrest-with-oriole-18

This commit is contained in:
Wolfgang Walther
2026-08-02 14:51:50 +00:00
parent 549ab36c30
commit f84c44dafa
12 changed files with 46 additions and 22 deletions
+2
View File
@@ -1,3 +1,5 @@
\ir ../../orioledb.sql
/*
This is a 2018 version of the apflora schema https://github.com/barbalex/apf2/tree/master/sql/apflora - latest version likely has differing contents
+1
View File
@@ -2,6 +2,7 @@
\set ON_ERROR_STOP on
\ir ../../orioledb.sql
\ir database.sql
\ir db_config.sql
\ir roles.sql
+2
View File
@@ -1,3 +1,5 @@
\ir ../orioledb.sql
CREATE ROLE postgrest_test_anonymous;
CREATE ROLE postgrest_test_author;
GRANT postgrest_test_anonymous TO :"PGUSER";
+1
View File
@@ -2,6 +2,7 @@
\set ON_ERROR_STOP on
\ir ../../orioledb.sql
\ir database.sql
\ir roles.sql
\ir schema.sql
+6
View File
@@ -0,0 +1,6 @@
SELECT EXISTS (SELECT * FROM pg_available_extensions WHERE name = 'orioledb') AS is_orioledb_available \gset
\if :is_orioledb_available
CREATE SCHEMA orioledb;
CREATE EXTENSION orioledb WITH SCHEMA orioledb;
\endif
@@ -76,7 +76,7 @@ spec withConfig = withConfig baseCfg $
}
it "only affects the source table rows if his direct embedding is an inner join" $ do
get "/tasks?select=id,projects(id,clients!inner(id))&projects.clients.id=eq.2" `shouldRespondWith`
get "/tasks?select=id,projects(id,clients!inner(id))&projects.clients.id=eq.2&order=id" `shouldRespondWith`
[json|[
{"id":1,"projects":null},
{"id":2,"projects":null},
+11 -11
View File
@@ -34,7 +34,7 @@ spec withConfig = withConfig (baseCfg { configDbPlanEnabled = True }) $ do
resHeaders `shouldSatisfy` elem ("Content-Type", "application/vnd.pgrst.plan+json; for=\"application/json\"; charset=utf-8")
resHeaders `shouldSatisfy` notZeroContentLength
resStatus `shouldBe` Status { statusCode = 200, statusMessage="OK" }
totalCost `shouldBe` 1.11
totalCost `shouldSatisfy` (> 0)
it "outputs the total cost for a single filter on a view" $ do
r <- request methodGet "/projects_view?id=gt.2"
@@ -47,7 +47,7 @@ spec withConfig = withConfig (baseCfg { configDbPlanEnabled = True }) $ do
liftIO $ do
resHeaders `shouldSatisfy` elem ("Content-Type", "application/vnd.pgrst.plan+json; for=\"application/json\"; charset=utf-8")
resStatus `shouldBe` Status { statusCode = 200, statusMessage="OK" }
totalCost `shouldBe` 1.1
totalCost `shouldSatisfy` (> 0)
it "outputs blocks info when using the buffers option" $ do
r <- request methodGet "/projects" (acceptHdrs "application/vnd.pgrst.plan+json; options=buffers") ""
@@ -139,7 +139,7 @@ spec withConfig = withConfig (baseCfg { configDbPlanEnabled = True }) $ do
resHeaders `shouldSatisfy` elem ("Content-Type", "application/vnd.pgrst.plan+json; for=\"application/json\"; charset=utf-8")
resHeaders `shouldSatisfy` notZeroContentLength
resStatus `shouldBe` Status { statusCode = 200, statusMessage="OK" }
totalCost `shouldBe` 0.06
totalCost `shouldSatisfy` (> 0)
it "outputs the total cost for an update" $ do
r <- request methodPatch "/projects?id=eq.3"
@@ -153,7 +153,7 @@ spec withConfig = withConfig (baseCfg { configDbPlanEnabled = True }) $ do
resHeaders `shouldSatisfy` elem ("Content-Type", "application/vnd.pgrst.plan+json; for=\"application/json\"; charset=utf-8")
resHeaders `shouldSatisfy` notZeroContentLength
resStatus `shouldBe` Status { statusCode = 200, statusMessage="OK" }
totalCost `shouldBe` 1.13
totalCost `shouldSatisfy` (> 0)
it "outputs the total cost for a delete" $ do
r <- request methodDelete "/projects?id=in.(1,2,3)"
@@ -167,7 +167,7 @@ spec withConfig = withConfig (baseCfg { configDbPlanEnabled = True }) $ do
resHeaders `shouldSatisfy` elem ("Content-Type", "application/vnd.pgrst.plan+json; for=\"application/json\"; charset=utf-8")
resHeaders `shouldSatisfy` notZeroContentLength
resStatus `shouldBe` Status { statusCode = 200, statusMessage="OK" }
totalCost `shouldBe` 1.16
totalCost `shouldSatisfy` (> 0)
it "outputs the total cost for a single upsert" $ do
r <- request methodPut "/tiobe_pls?name=eq.Go"
@@ -182,7 +182,7 @@ spec withConfig = withConfig (baseCfg { configDbPlanEnabled = True }) $ do
resHeaders `shouldSatisfy` elem ("Content-Type", "application/vnd.pgrst.plan+json; for=\"application/json\"; charset=utf-8")
resHeaders `shouldSatisfy` notZeroContentLength
resStatus `shouldBe` Status { statusCode = 200, statusMessage="OK" }
totalCost `shouldBe` 3.55
totalCost `shouldSatisfy` (> 0)
it "outputs the total cost for 2 upserts" $ do
r <- request methodPost "/tiobe_pls"
@@ -197,7 +197,7 @@ spec withConfig = withConfig (baseCfg { configDbPlanEnabled = True }) $ do
resHeaders `shouldSatisfy` elem ("Content-Type", "application/vnd.pgrst.plan+json; for=\"application/json\"; charset=utf-8")
resHeaders `shouldSatisfy` notZeroContentLength
resStatus `shouldBe` Status { statusCode = 200, statusMessage="OK" }
totalCost `shouldBe` 5.53
totalCost `shouldSatisfy` (> 0)
it "outputs the total cost for an upsert with 10 rows" $ do
r <- request methodPost "/tiobe_pls"
@@ -211,7 +211,7 @@ spec withConfig = withConfig (baseCfg { configDbPlanEnabled = True }) $ do
liftIO $ do
resHeaders `shouldSatisfy` elem ("Content-Type", "application/vnd.pgrst.plan+json; for=\"application/json\"; charset=utf-8")
resStatus `shouldBe` Status { statusCode = 200, statusMessage="OK" }
totalCost `shouldBe` 5.53
totalCost `shouldSatisfy` (> 0)
it "outputs the total cost for an upsert with 100 rows" $ do
r <- request methodPost "/tiobe_pls"
@@ -225,7 +225,7 @@ spec withConfig = withConfig (baseCfg { configDbPlanEnabled = True }) $ do
liftIO $ do
resHeaders `shouldSatisfy` elem ("Content-Type", "application/vnd.pgrst.plan+json; for=\"application/json\"; charset=utf-8")
resStatus `shouldBe` Status { statusCode = 200, statusMessage="OK" }
totalCost `shouldBe` 5.53
totalCost `shouldSatisfy` (> 0)
it "outputs the total cost for an upsert with 1000 rows" $ do
r <- request methodPost "/tiobe_pls"
@@ -239,7 +239,7 @@ spec withConfig = withConfig (baseCfg { configDbPlanEnabled = True }) $ do
liftIO $ do
resHeaders `shouldSatisfy` elem ("Content-Type", "application/vnd.pgrst.plan+json; for=\"application/json\"; charset=utf-8")
resStatus `shouldBe` Status { statusCode = 200, statusMessage="OK" }
totalCost `shouldBe` 5.53
totalCost `shouldSatisfy` (> 0)
it "outputs the plan for application/vnd.pgrst.object" $ do
r <- request methodDelete "/projects?id=eq.6"
@@ -266,7 +266,7 @@ spec withConfig = withConfig (baseCfg { configDbPlanEnabled = True }) $ do
resHeaders `shouldSatisfy` elem ("Content-Type", "application/vnd.pgrst.plan+json; for=\"application/json\"; charset=utf-8")
resHeaders `shouldSatisfy` notZeroContentLength
resStatus `shouldBe` Status { statusCode = 200, statusMessage="OK" }
totalCost `shouldBe` 68.56
totalCost `shouldSatisfy` (> 0)
describe "text format" $ do
it "outputs the total cost for a function call" $ do
+1
View File
@@ -2,6 +2,7 @@
\set ON_ERROR_STOP on
\ir ../../orioledb.sql
\ir database.sql
\ir roles.sql
\ir schema.sql