diff --git a/nix/tools/withTools.nix b/nix/tools/withTools.nix index da7d72fe0..0b55b2451 100644 --- a/nix/tools/withTools.nix +++ b/nix/tools/withTools.nix @@ -19,6 +19,7 @@ let autovacuum = false listen_addresses = '' log_statement = all + shared_preload_libraries=pg_stat_statements "; in checkedShellScript diff --git a/test/spec/Feature/Query/PlanSpec.hs b/test/spec/Feature/Query/PlanSpec.hs index c2eb5bb77..cc23ea1df 100644 --- a/test/spec/Feature/Query/PlanSpec.hs +++ b/test/spec/Feature/Query/PlanSpec.hs @@ -94,6 +94,16 @@ spec withConfig = withConfig (baseCfg { configDbPlanEnabled = True }) $ do resHeaders `shouldSatisfy` elem ("Content-Type", "application/vnd.pgrst.plan+json; for=\"application/json\"; options=verbose; charset=utf-8") cols `shouldBe` Just [aesonQQ| ["projects.id", "projects.name", "projects.client_id"] |] + it "includes the Query Identifier field when using the verbose option" $ do + r <- request methodGet "/projects" (acceptHdrs "application/vnd.pgrst.plan+json; options=verbose") "" + + let queryIdentifier = simpleBody r ^? nth 0 . key "Query Identifier" + resHeaders = simpleHeaders r + + liftIO $ do + resHeaders `shouldSatisfy` elem ("Content-Type", "application/vnd.pgrst.plan+json; for=\"application/json\"; options=verbose; charset=utf-8") + queryIdentifier `shouldSatisfy` isJust + it "outputs the plan for application/json " $ do r <- request methodGet "/projects" (acceptHdrs "application/vnd.pgrst.plan+json; for=\"application/json\"; options=verbose") ""