Liking cljdoc? Tell your friends :D

magnetcoop.stork


complement-migrationclj

(complement-migration conn migration)

If migration contains tx-data, function returns migration unchanged. If it contains tx-data-fn instead then it evaluates resolved symbol and merges the result with migration.

If migration contains tx-data, function returns migration unchanged.
If it contains tx-data-fn instead then it evaluates resolved symbol
and merges the result with migration.
sourceraw docstring

ensure-installedclj

(ensure-installed conn migration)

Ensure that migration is installed, be it schema, data or otherwise. A migration is represented in a format of a map with kv pairs:

:id - unique identifier of the migration. The id needs to be of type clojure.lang.Keyword. No migrations having same id will get installed after this one has been installed. :tx-data - a vector of datoms to be transacted if migration is not installed yet. :tx-data-fn - an alternative to :tx-data. It's a symbol representing a function that will be ran to produce tx-data. The function will be ran with one argument - conn.

If migration hasn't been installed before then function will return with a transaction result. It will return ::already-installed otherwise. Throws ExceptionInfo if the migration cant be transacted, including details about the failure.

Ensure that migration is installed, be it schema, data or otherwise.
 A migration is represented in a format of a map with kv pairs:

   :id         - unique identifier of the migration. The id needs to be of type clojure.lang.Keyword.
                 No migrations having same id will get installed after this one has been installed.
   :tx-data    - a vector of datoms to be transacted if migration is not installed yet.
   :tx-data-fn - an alternative to `:tx-data`.
                 It's a symbol representing a function that will be ran to produce tx-data.
                 The function will be ran with one argument - conn.

If migration hasn't been installed before then function will return with a transaction result.
It will return `::already-installed` otherwise.
Throws ExceptionInfo if the migration cant be transacted, including details about the failure.
sourceraw docstring

ensure-migration-should-be-installedclj

Transaction function to ensure that each migration is executed exactly only when a migration-id isn't known to had been installed in past.

Transaction function to ensure that each migration is executed exactly only
when a migration-id isn't known to had been installed in past.
sourceraw docstring

ensure-migration-txclj

Ident for a function installed in datomic. See ensure-migration-should-be-installed

Ident for a function installed in datomic.
See `ensure-migration-should-be-installed`
sourceraw docstring

ensure-stork-schemaclj

(ensure-stork-schema conn)

Makes sure that library vitals are installed into the db:

  1. An attribute to store information about successfully installed migrations.
  2. A custom datomic function for safe migration installing (see :stork/ensure-migration-should-be-installed-txfn)
Makes sure that library vitals are installed into the db:
1) An attribute to store information about successfully installed migrations.
2) A custom datomic function for safe migration installing (see `:stork/ensure-migration-should-be-installed-txfn`)
sourceraw docstring

eval-tx-data-fnclj

(eval-tx-data-fn conn tx-data-fn)

Tries to resolve the symbol that contains the function. It's evaluation should result in a valid tx-data.

Tries to resolve the symbol that contains the function.
It's evaluation should result in a valid tx-data.
sourceraw docstring

handle-migrationclj

(handle-migration conn {:keys [id] :as migration})

Checks if a migration's id is known to be installed already. If it is, return ::already-installed. Otherwise transact tx-data (be it explicitly given or evaluated from tx-data-fn) and return transaction's result.

Checks if a migration's id is known to be installed already.
If it is, return ::already-installed.
Otherwise transact tx-data (be it explicitly given or evaluated from tx-data-fn)
and return transaction's result.
sourceraw docstring

handle-tx-dataclj

(handle-tx-data conn migration-id tx-data sync-schema-timeout)

Tries to transact tx-data using custom :stork/:stork/ensure-migration-should-be-installed.

Tries to transact tx-data using custom :stork/:stork/ensure-migration-should-be-installed.
sourceraw docstring

has-attribute?clj

(has-attribute? db attr-name)

Checks if an attribute is installed into db schema.

Checks if an attribute is installed into db schema.
sourceraw docstring

has-function?clj

(has-function? db fn-name)

Checks if an entity (queried by ident) has a function installed.

Checks if an entity (queried by ident) has a function installed.
sourceraw docstring

installed-migrations-attributeclj

source

installed?clj

(installed? db migration-id)

Checks if a migration-id is known to be already installed into the db.

Checks if a migration-id is known to be already installed into the db.
sourceraw docstring

maybe-timeout-synch-schemaclj

(maybe-timeout-synch-schema conn maybe-timeout)
source

read-resourceclj

(read-resource resource-name)
(read-resource opts resource-name)

Reads and returns data from a resource containing edn text. An optional argument allows specifying opts for clojure.edn/read

Reads and returns data from a resource containing edn text.
An optional argument allows specifying opts for clojure.edn/read
sourceraw docstring

tx-data-xor-tx-data-fn?clj

(tx-data-xor-tx-data-fn? {:keys [tx-data tx-data-fn]})

Returns true if: a) tx-data is present and tx-data-fn is not b) tx-data-fn is present and tx-data is not Returns false otherwise.

Returns true if:
a) tx-data is present and tx-data-fn is not
b) tx-data-fn is present and tx-data is not
Returns false otherwise.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close