From 67b1556f1f4f38d5e86b835b2c6cecaa301a1e75 Mon Sep 17 00:00:00 2001 From: Tarun Date: Fri, 5 Jan 2024 09:56:28 +0530 Subject: [PATCH] Convert db response keys to kebab case --- swift-ticketing/src/swift_ticketing/db/query.clj | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/swift-ticketing/src/swift_ticketing/db/query.clj b/swift-ticketing/src/swift_ticketing/db/query.clj index 3bfea0a..c8fa4ac 100644 --- a/swift-ticketing/src/swift_ticketing/db/query.clj +++ b/swift-ticketing/src/swift_ticketing/db/query.clj @@ -1,15 +1,18 @@ (ns swift-ticketing.db.query (:require [next.jdbc :as jdbc] - [next.jdbc.result-set :as rs])) + [next.jdbc.result-set :as rs] + [camel-snake-kebab.core :as csk] + [camel-snake-kebab.extras :as cske])) (defn- run-query-with [f db-spec query] - (f db-spec query {:builder-fn rs/as-unqualified-maps})) + (cske/transform-keys csk/->kebab-case-keyword + (f db-spec query {:builder-fn rs/as-unqualified-maps}))) (defn run-query! [db-spec query] - (run-query-with jdbc/execute! db-spec query)) + (run-query-with jdbc/execute! db-spec query)) (defn run-query-one! [db-spec query] - (run-query-with jdbc/execute-one! db-spec query)) + (run-query-with jdbc/execute-one! db-spec query))