;; This Source Code Form is subject to the terms of the Mozilla Public ;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; file, You can obtain one at http://mozilla.org/MPL/2.0/. (ns datomish.db-factory #?(:cljs (:require-macros [datomish.pair-chan :refer [go-pair !]]]) #?@(:cljs [[datomish.pair-chan] [cljs.core.async :as a :refer [chan !]]])) #?(:clj (:import [datomish.datom Datom]))) (defn (integer entid), like {:db/ident 0}." (go-pair (let [rows (> {:select [:ident :entid] :from [:idents]} (s/format) (s/all-rows sqlite-connection)))] (into {} (map (fn [row] [(sqlite-schema/<-SQLite :db.type/keyword (:ident row)) (:entid row)])) rows)))) (defn (map (keyword attribute -> keyword value)), like {:db/ident {:db/cardinality :db.cardinality/one}}." (go-pair (->> (->> {:select [:ident :attr :value] :from [:schema]} (s/format) (s/all-rows sqlite-connection)) ( db ;; We use