Back

close-datasource (clj)

(source)

function

(close-datasource datasource)
Close given `datasource`

Examples

kit-clj/kit
(ns kit.edge.db.sql.hikari
  (:require
    [hikari-cp.core :as cp]
    [integrant.core :as ig]
    [kit.ig-utils :as ig-utils]
    ))

(defmethod ig/halt-key! :db.sql/hikari-connection
  [_ conn]
  (cp/close-datasource conn))
clojure-garden/clojure-garden
(ns platform.system.database
  (:require
    [hikari-cp.core :as hk]
    [integrant.core :as ig]))


(defmethod ig/halt-key! :platform.system/database [_ db-spec]
  (-> db-spec :datasource hk/close-datasource))
markbastian/partsbin
(ns partsbin.hikari-cp.core.alpha
  "Note - alpha namespace is subject to change."
  (:require [integrant.core :as ig]
            [hikari-cp.core :as hcp]
            [taoensso.timbre :as timbre]))

(defmethod ig/halt-key! ::datasource [_ datasource]
  (timbre/debug "Closing datasource.")
  (hcp/close-datasource datasource))
dpom/nlp-tools
(ns nlptools.module.db
  (:require
   [clojure.java.jdbc :as j]
   [hikari-cp.core :as hik]
   [integrant.core :as ig]
  ))


(defmethod ig/halt-key! :nlptools.module/db [_ db]
  (hik/close-datasource (get-in db [:dbspec :datasource])))