This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns datascript-to-datomic-util | |
(:require [datascript :as d])) | |
;;;; a utility to help with a datomic-datascript roundtrip process involving: | |
;;; 1. export some data from a datomic database and transact into a datascript instance. | |
;;; 2. perform one or more transactions against datascript. | |
;;; 3. transact the sum of all changes made against datascript back into datomic in a single tx | |
;;; this namespace contains two public functions: | |
;;; listen-for-changes: listen to datascript transactions and build up a record of changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns com.x.aleph-test | |
(require [aleph.http :as http] | |
[manifold.deferred :as d] | |
[manifold.stream :as s] | |
[compojure.core :only [routes ANY GET PUT POST] :as compojure] | |
[compojure.handler :as handler] | |
[clj-http.client :as http-client] | |
)) | |
(comment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def uri "datomic:mem://my-db") | |
(d/create-database uri) | |
(def conn (d/connect uri)) | |
(d/transact conn [ | |
{:db/id #db/id [:db.part/db] | |
:db/ident :entity/name | |
:db/valueType :db.type/string | |
:db/isComponent true |