From dbe4737270878d89e1095c4bb98ca73ae29bb51c Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Mon, 26 Jul 2021 23:04:38 -0700 Subject: [PATCH] Addresses #173 --- CHANGELOG.md | 1 + src/next/jdbc/result_set.clj | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 844122f..5bd20c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Only accretive/fixative changes will be made from now on. * 1.2.next in progress + * Address #173 by extending `DatafiableRow` to `ResultSet` so there's a public method to call on (rows of) a JDBC result set directly. * Address #169 by expanding the description of `with-transaction` in **Getting Started**. * 1.2.674 -- 2021-06-16 diff --git a/src/next/jdbc/result_set.clj b/src/next/jdbc/result_set.clj index 2bb42fe..23506ab 100644 --- a/src/next/jdbc/result_set.clj +++ b/src/next/jdbc/result_set.clj @@ -593,6 +593,13 @@ (prefer-method print-method MapifiedResultSet clojure.lang.IPersistentMap) +(extend-protocol + DatafiableRow + ResultSet + (datafiable-row [this connectable opts] + (let [mapped (mapify-result-set this opts)] + (datafiable-row mapped connectable opts)))) + (extend-protocol DatafiableRow clojure.lang.IObj ; assume we can "navigate" anything that accepts metadata