From 0425e8895c398eaf649f2dc7c4b4be472b52af72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Zahradn=C3=ADk?= Date: Sat, 4 Jun 2022 14:12:08 +0200 Subject: [PATCH] add postgres json literal --- postgres/literal.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/postgres/literal.go b/postgres/literal.go index 7b1bd19..929e394 100644 --- a/postgres/literal.go +++ b/postgres/literal.go @@ -65,6 +65,11 @@ func String(value string) StringExpression { return CAST(jet.String(value)).AS_TEXT() } +// Json creates new json literal expression +func Json(value string) StringExpression { + return StringExp(CAST(jet.String(value)).AS("json")) +} + // UUID is a helper function to create string literal expression from uuid object // value can be any uuid type with a String method var UUID = jet.UUID