From ff3caec36cddae27c6fc98224df907ba6357e672 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 9 Jun 2021 16:57:10 +0200 Subject: [PATCH] :tada: Add decode-inet helper on app.db ns. --- backend/src/app/db.clj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/src/app/db.clj b/backend/src/app/db.clj index e1455e719..6e2e086bb 100644 --- a/backend/src/app/db.clj +++ b/backend/src/app/db.clj @@ -349,6 +349,12 @@ (.setType "inet") (.setValue (str ip-addr)))) +(defn decode-inet + [^PGobject o] + (if (= "inet" (.getType o)) + (.getValue o) + nil)) + (defn tjson "Encode as transit json." [data]