Skip to content

Commit

Permalink
Allow config setting to disable consistency check. (#693)
Browse files Browse the repository at this point in the history
* Allow config setting to disable consistency check.

* Add documentation to config mismatch error.
  • Loading branch information
whilo authored Sep 11, 2024
1 parent 1c0822e commit f85c748
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/datahike/connector.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
config (update config :store ds/store-identity)
stored-config (update stored-config :store ds/store-identity)]
(when-not (= config stored-config)
(dt/raise "Configuration does not match stored configuration."
(dt/raise "Configuration does not match stored configuration. In some cases this check is too restrictive. If you are sure you are loading the right database with the right configuration then you can disable this check by setting :allow-unsafe-config to true in your config."
{:type :config-does-not-match-stored-db
:config config
:stored-config stored-config
Expand Down Expand Up @@ -184,7 +184,8 @@
[config store stored-db]))
[config store stored-db]))
_ (version-check stored-db)
_ (ensure-stored-config-consistency config (:config stored-db))
_ (when-not (:allow-unsafe-config config)
(ensure-stored-config-consistency config (:config stored-db)))
conn (conn-from-db (dsi/stored->db (assoc stored-db :config config) store))]
(swap! (:wrapped-atom conn) assoc :writer
(w/create-writer (:writer config) conn))
Expand Down

0 comments on commit f85c748

Please sign in to comment.