From bf91187e6345916cc12cc946dc070892241e9b28 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Mon, 6 Sep 2021 17:56:58 -0500 Subject: [PATCH] Drop support for embed hints used as '.' Hints used like `select=projects.client_id(*)` were already deprecated. '!' should be used from now on `select=projects!client_id(*)` --- src/PostgREST/Request/Parsers.hs | 6 +----- test/Feature/EmbedDisambiguationSpec.hs | 10 ---------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/PostgREST/Request/Parsers.hs b/src/PostgREST/Request/Parsers.hs index a73ea2690..ac9392657 100644 --- a/src/PostgREST/Request/Parsers.hs +++ b/src/PostgREST/Request/Parsers.hs @@ -158,11 +158,7 @@ pRelationSelect :: Parser SelectItem pRelationSelect = lexeme $ try ( do alias <- optionMaybe ( try(pFieldName <* aliasSeparator) ) fld <- pField - hint <- optionMaybe ( - try ( char '!' *> pFieldName) <|> - -- deprecated, remove in next major version - try ( char '.' *> pFieldName) - ) + hint <- optionMaybe $ char '!' *> pFieldName return (fld, Nothing, alias, hint) ) diff --git a/test/Feature/EmbedDisambiguationSpec.hs b/test/Feature/EmbedDisambiguationSpec.hs index 9db3c3ead..f3fa405cd 100644 --- a/test/Feature/EmbedDisambiguationSpec.hs +++ b/test/Feature/EmbedDisambiguationSpec.hs @@ -423,16 +423,6 @@ spec = "refereeds":[]}] }]|] { matchHeaders = [matchContentTypeJson] } - -- TODO Remove in next major version - describe "old dot '.' symbol, deprecated" $ - it "still works" $ do - get "/clients?id=eq.1&select=id,projects:projects.client_id(id,tasks(id))" `shouldRespondWith` - [json|[{"id":1,"projects":[{"id":1,"tasks":[{"id":1},{"id":2}]},{"id":2,"tasks":[{"id":3},{"id":4}]}]}]|] - { matchHeaders = [matchContentTypeJson] } - get "/tasks?select=id,users:users.users_tasks(id)" `shouldRespondWith` - [json|[{"id":1,"users":[{"id":1},{"id":3}]},{"id":2,"users":[{"id":1}]},{"id":3,"users":[{"id":1}]},{"id":4,"users":[{"id":1}]},{"id":5,"users":[{"id":2},{"id":3}]},{"id":6,"users":[{"id":2}]},{"id":7,"users":[{"id":2}]},{"id":8,"users":[]}]|] - { matchHeaders = [matchContentTypeJson] } - context "m2m embed when there's a junction in an internal schema" $ do -- https://github.com/PostgREST/postgrest/issues/1736 it "works with no ambiguity when there's an exposed view of the junction" $ do