File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change
1
+ (ns <<ns-name>>.datomic
2
+ (:require [clojure.tools.logging :as log]
3
+ [datomic.api :as d]
4
+ [integrant.core :as ig]))
5
+
6
+ (defmethod ig /init-key :db.datomic/conn
7
+ [_ {:keys [db-uri]}]
8
+ (when (d/create-database db-uri)
9
+ (log/info (str " Database " db-uri " created (didn't exist)" )))
10
+ (d/connect db-uri))
11
+
12
+ (defmethod ig /halt-key! :db.datomic/conn
13
+ [_ conn]
14
+ (d/release conn))
Original file line number Diff line number Diff line change
1
+ {:default
2
+ {:require-restart? true
3
+ :actions
4
+ {:assets [[" assets/src/datomic.clj" " src/clj/<<sanitized>>/datomic.clj" ]]
5
+ :injections
6
+ [{:action :merge
7
+ :path " resources/system.edn"
8
+ :target []
9
+ :type :edn
10
+ :value
11
+ {:db.datomic/conn
12
+ #profile
13
+ {:dev {:db-uri #or [#env DATOMIC_DB_URI " datomic:dev://localhost:4334/<<name>>" ]}
14
+ :test {:db-uri #or [#env DATOMIC_DB_URI_TEST " datomic:dev://localhost:4334/<<name>>_test" ]}
15
+ :prod {:db-uri #env DATOMIC_DB_URI}}}}
16
+
17
+ {:action :merge
18
+ :path " deps.edn"
19
+ :target [:deps ]
20
+ :type :edn
21
+ :value {com.datomic/peer {:mvn/version " 1.0.7075" }}}
22
+
23
+ {:action :append-requires
24
+ :path " src/clj/<<sanitized>>/core.clj"
25
+ :type :clj
26
+ :value [" [<<ns-name>>.datomic]" ]}]}}}
Original file line number Diff line number Diff line change 44
44
:doc " adds support for kit-Hato HTTP client" }
45
45
:kit/codox
46
46
{:path " codox"
47
- :doc " adds support for codox" }}}
47
+ :doc " adds support for codox" }
48
+ :kit/datomic
49
+ {:path " datomic"
50
+ :doc " adds support for Datomic" }}}
You can’t perform that action at this time.
0 commit comments