    {:target (. js/document (getElementById "topiq-container"))}))
 
 
+;; prototype helpers to reimport DB on schema changes etc.
+;; TODO serialize datascript/DB properly with incognito
+(defn ^:export print-db []
+  (println (pr-str @val-atom)))
+
+(defn ^:export read-db [db-str]
+  (go
+    (.info js/console (<! (sc/transact stage ["eve@topiq.es" #uuid "26558dfe-59bb-4de4-95c3-4028c56eb5b5"]
+                                       '(fn [old params] (d/db-with old params))
+                                       (mapv (fn [datom] (into [:db/add] datom))
+                                             (read-string db-str)))))
+    (.info js/console (<! (sc/commit! stage {"eve@topiq.es" #{#uuid "26558dfe-59bb-4de4-95c3-4028c56eb5b5"}})))))
+
+
+
 (comment
   ;; jack in figwheel cljs REPL
   (require 'figwheel-sidecar.repl-api)

        (<! (timeout 100)))
      (def benchmark (- (js/Date.) start))))

  (-> @stage :volatile :peer deref :volatile :store :state deref keys)

  )

  (get-in @stage ["banana@joe.com" #uuid "26558dfe-59bb-4de4-95c3-4028c56eb5b5" :state :heads])

  (get-in @stage [:config])



  ;; recreate database
  (sc/create-cdvcs! stage
