encode json body in binary, using modified hasql dep

- switch from "unknown" parameter in text format to a "json" parameter in
  binary format (no dependency update required)
- use a lazy bytestring "json" encoder (via updated hasql)
This commit is contained in:
Robert Vollmert
2022-09-19 20:49:11 +02:00
committed by Robert
parent efd65ff1f4
commit 38ecaa44db
6 changed files with 106 additions and 34 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ normalizedBody body =
"END AS val",
"FROM pgrst_payload)"])
where
jsonPlaceHolder = SQL.encoderAndParam (HE.nullable HE.unknown) (LBS.toStrict <$> body) <> "::json"
jsonPlaceHolder = SQL.encoderAndParam (HE.nullable HE.jsonLazyBytes) body
singleParameter :: Maybe LBS.ByteString -> ByteString -> SQL.Snippet
singleParameter body typ =