Copy a Datahike store into a NEW store with :keep-history? false.
Datahike validates the connect-time config against the stored one, so
:keep-history? cannot be changed in place — a store created with history
refuses to open under a config that disables it. The only route is a copy.
Contract: (plan source-cfg target-cfg) => the migration plan, no I/O beyond a read (migrate! opts) => Result<report>
migrate! NEVER writes to, deletes, or reconfigures the source. It refuses
to run without :i-mean-it true, and refuses a target that already exists.
Copy a Datahike store into a NEW store with `:keep-history? false`. Datahike validates the connect-time config against the stored one, so `:keep-history?` cannot be changed in place — a store created with history refuses to open under a config that disables it. The only route is a copy. Contract: (plan source-cfg target-cfg) => the migration plan, no I/O beyond a read (migrate! opts) => Result<report> `migrate!` NEVER writes to, deletes, or reconfigures the source. It refuses to run without `:i-mean-it true`, and refuses a target that already exists.
(migrate! {:keys [source-cfg target-cfg schema batch-size i-mean-it]
:or {batch-size 1000}})Copy :source-cfg's current state into :target-cfg with history off.
opts: :source-cfg (required) config of the store to read :target-cfg (required) config of the store to create; must name a DIFFERENT path, and must not already exist :schema (required) the schema tx to install in the target :batch-size datoms per transaction (default 1000) :i-mean-it must be true — this creates a second copy of the store
Returns Result<{:before {...} :after {...} :copied n :verified? bool}>. The source is opened read-only and released untouched.
Copy `:source-cfg`'s current state into `:target-cfg` with history off.
opts:
:source-cfg (required) config of the store to read
:target-cfg (required) config of the store to create; must name a
DIFFERENT path, and must not already exist
:schema (required) the schema tx to install in the target
:batch-size datoms per transaction (default 1000)
:i-mean-it must be true — this creates a second copy of the store
Returns Result<{:before {...} :after {...} :copied n :verified? bool}>.
The source is opened read-only and released untouched.(no-history-cfg cfg)cfg with history disabled. The store path/id must already differ from the
source's — migrate! enforces that.
`cfg` with history disabled. The store path/id must already differ from the source's — `migrate!` enforces that.
(plan source-cfg target-cfg)What the migration would do. Pure with respect to the target.
What the migration would do. Pure with respect to the target.
(schema-entity-ids db)Entity ids of schema entities — those carrying a :db/ident. Their datoms
are reproduced by transacting the schema, not by copying.
Entity ids of schema entities — those carrying a `:db/ident`. Their datoms are reproduced by transacting the schema, not by copying.
(source-census db)Datom and entity counts of the source, for the before/after comparison.
Datom and entity counts of the source, for the before/after comparison.
(user-datoms db)Current-state datoms excluding schema entities, as [e a v] triples.
Current-state datoms excluding schema entities, as [e a v] triples.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |