File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 198198 file-graph-import? (assoc :import-type :file-graph )))
199199 _ (start-repo-db-if-not-exists! full-graph-name)
200200 _ (state/add-repo! {:url full-graph-name :root (config/get-local-dir full-graph-name)})
201- _ (restore-and-setup-repo! full-graph-name)
201+ _ (restore-and-setup-repo! full-graph-name { :file-graph-import? file-graph-import?} )
202202 _ (when-not file-graph-import? (route-handler/redirect-to-home! ))
203203 _ (repo-config-handler/set-repo-config-state! full-graph-name config/config-default-content)
204204 ; ; TODO: handle global graph
Original file line number Diff line number Diff line change 219219 _ (when disk-db-data
220220 (state/<invoke-db-worker-direct-pass :thread-api/import-db repo disk-db-data))
221221 _ (state/<invoke-db-worker :thread-api/create-or-open-db repo opts)]
222- (state/<invoke-db-worker :thread-api/get-initial-data repo))
222+ (state/<invoke-db-worker :thread-api/get-initial-data repo opts ))
223223 (p/catch sqlite-error-handler)))
224224
225225 (<export-db [_this repo opts]
Original file line number Diff line number Diff line change 553553 (throw e)))))
554554
555555(def-thread-api :thread-api/get-initial-data
556- [repo]
556+ [repo opts ]
557557 (when-let [conn (worker-state/get-datascript-conn repo)]
558- (common-initial-data/get-initial-data @conn)))
558+ (if (:file-graph-import? opts)
559+ {:schema (:schema @conn)
560+ :initial-data (vec (d/datoms @conn :eavt ))}
561+ (common-initial-data/get-initial-data @conn))))
559562
560563(def-thread-api :thread-api/reset-db
561564 [repo db-transit]
You can’t perform that action at this time.
0 commit comments