Skip to content

Commit b669b4f

Browse files
committed
Datomic local
1 parent 7f9ada5 commit b669b4f

File tree

3 files changed

+19
-25
lines changed

3 files changed

+19
-25
lines changed

CHANGELOG.org

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
* Changes
22
** 0.5.5-SNAPSHOT
33
- Init-fn for Mariadb component.
4-
- Support for EclipseStore, persistable atom component
4+
- Support for Datomic local. Init-fn takes the Datomic connection as argument.
55
** 0.5.4
66
- Support for multiple API handlers, which are siloed handlers with their own prefix, middleware and dependencies.
77
** 0.5.3
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
(ns system.components.datomic-local
2+
(:require [com.stuartsierra.component :as component]
3+
[datomic.client.api :as d]))
4+
5+
(defrecord DatomicLocal [cfg db init-fn]
6+
component/Lifecycle
7+
(start [component]
8+
(let [client (d/client cfg)
9+
_ (d/create-database client db)
10+
conn (d/connect client db)]
11+
(when init-fn
12+
(init-fn conn))
13+
(assoc component :client client :conn conn)))
14+
(stop [component]
15+
(dissoc component :client :conn)))
16+
17+
(defn new-datomic-local [& {:keys [cfg db init-fn]}]
18+
(map->DatomicLocal {:cfg cfg :db db :init-fn init-fn}))

src/system/components/eclipsestore.clj

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)