Fixes 500 when set returning function returns an empty row set [fix #332]

This commit is contained in:
Diogo Biazus
2015-10-27 21:19:55 -04:00
parent bd1826670e
commit 4369a5617e
3 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ asJsonWithCount = withCount . asJson
asJson :: StatementT
asJson s = s {
B.stmtTemplate =
"array_to_json(array_agg(row_to_json(t)))::character varying from ("
"array_to_json(coalesce(array_agg(row_to_json(t)), '{}'))::character varying from ("
<> B.stmtTemplate s <> ") t" }
withCount :: StatementT