fix(error): leaking table and function names when calculating hint

Increase similarity score to 0.75 from 0.33 for table and functions
error hint.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
This commit is contained in:
Taimoor Zaeem
2026-03-06 16:16:05 -05:00
committed by steve-chavez
parent 6f356e32b6
commit 73c8ae0bbc
8 changed files with 62 additions and 17 deletions
+4 -4
View File
@@ -18,9 +18,9 @@ spec = do
request methodPatch "/fake" []
[json| { "real": false } |]
`shouldRespondWith`
[json| {"code":"PGRST205","details":null,"hint":"Perhaps you meant the table 'test.factories'","message":"Could not find the table 'test.fake' in the schema cache"} |]
[json| {"code":"PGRST205","details":null,"hint":null,"message":"Could not find the table 'test.fake' in the schema cache"} |]
{ matchStatus = 404
, matchHeaders = ["Content-Length" <:> "157"]
, matchHeaders = ["Content-Length" <:> "115"]
}
@@ -363,9 +363,9 @@ spec = do
{"id": 204, "body": "yyy"},
{"id": 205, "body": "zzz"}]|]
`shouldRespondWith`
[json| {"code":"PGRST205","details":null,"hint":"Perhaps you meant the table 'test.articles'","message":"Could not find the table 'test.garlic' in the schema cache"} |]
[json| {"code":"PGRST205","details":null,"hint":null,"message":"Could not find the table 'test.garlic' in the schema cache"} |]
{ matchStatus = 404
, matchHeaders = ["Content-Length" <:> "158"]
, matchHeaders = ["Content-Length" <:> "117"]
}
context "apply defaults on missing values" $ do