(conforms-to? db norm)
(conforms-to? db conformity-attr norm)
Does database have a norm installed?
conformity-attr (optional) the keyword name of the attribute used to track conformity norm the keyword name of the norm you want to check tx-count the count of transactions for that norm
Does database have a norm installed? conformity-attr (optional) the keyword name of the attribute used to track conformity norm the keyword name of the norm you want to check tx-count the count of transactions for that norm
(default-conformity-attribute-for-db db)
Returns the default-conformity-attribute for a db.
Returns the default-conformity-attribute for a db.
(ensure-conformity-schema conn conformity-attr)
Ensure that the two attributes and one transaction function required to track conformity via the conformity-attr keyword parameter are installed in the database.
Ensure that the two attributes and one transaction function required to track conformity via the conformity-attr keyword parameter are installed in the database.
(ensure-conforms conn norm-map)
(ensure-conforms conn norm-map norm-names)
(ensure-conforms conn conformity-attr norm-map norm-names)
Ensure that norms represented as datoms are conformed-to (installed), be they schema, data or otherwise.
conformity-attr (optional) the keyword name of the attribute used to
track conformity
norm-map a map from norm names to data maps.
a data map contains:
:tx - the data to install
:tx-fn - An alternative to txes, pointing to a
symbol representing a fn on the classpath that
will return transactions.
:requires - (optional) a list of prerequisite norms
in norm-map.
norm-names (optional) A collection of names of norms to conform to.
Will use keys of norm-map if not provided.
On success, returns a vector of maps with values for :norm-name, :tx-index, and :tx-result for each transaction that improved the db's conformity.
On failure, throws an ex-info with a reason and data about any partial success before the failure.
Ensure that norms represented as datoms are conformed-to (installed), be they schema, data or otherwise. conformity-attr (optional) the keyword name of the attribute used to track conformity norm-map a map from norm names to data maps. a data map contains: :tx - the data to install :tx-fn - An alternative to txes, pointing to a symbol representing a fn on the classpath that will return transactions. :requires - (optional) a list of prerequisite norms in norm-map. norm-names (optional) A collection of names of norms to conform to. Will use keys of norm-map if not provided. On success, returns a vector of maps with values for :norm-name, :tx-index, and :tx-result for each transaction that improved the db's conformity. On failure, throws an ex-info with a reason and data about any partial success before the failure.
Transaction function to ensure each norm tx is executed exactly once
Transaction function to ensure each norm tx is executed exactly once
(eval-tx-fn conn tx-fn)
Given a connection and a symbol referencing a function on the classpath...
require
the symbol's namespaceresolve
the symbolGiven a connection and a symbol referencing a function on the classpath... - `require` the symbol's namespace - `resolve` the symbol - evaluate the function, passing it the connection - return the result
(get-norm conn norm-map norm-name)
Pull from norm-map
the norm-name
value. If the norm contains a
tx-fn
key, allow processing of that key to stand in for a tx
value. Returns the value containing transactable data.
Pull from `norm-map` the `norm-name` value. If the norm contains a `tx-fn` key, allow processing of that key to stand in for a `tx` value. Returns the value containing transactable data.
(has-attribute? db attr-name)
Returns true if a database has an attribute named attr-name
Returns true if a database has an attribute named attr-name
(has-function? db fn-name)
Returns true if a database has a function named fn-name
Returns true if a database has a function named fn-name
(maybe-timeout-synch-schema conn maybe-timeout)
(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
(reduce-norms acc conn norm-attr norm-map norm-names)
Reduces norms from a norm-map specified by a seq of norm-names into a transaction result accumulator
Reduces norms from a norm-map specified by a seq of norm-names into a transaction result accumulator
(transact-tx acc conn norm-attr norm-name tx sync-schema-timeout)
Transacts the norm, tx
, and adds result to accumulator.
Transacts the norm, `tx`, and adds result to accumulator.
(with-conforms db norm-map)
(with-conforms db norm-map norm-names)
(with-conforms db conformity-attr norm-map norm-names)
Variation of ensure-conforms that speculatively ensures norm are conformed to
On success, returns a map with: :db the resulting database that conforms the the provided norms :result a vector of maps with values for :norm-name, :tx-index, and :tx-result for each transaction that improved the db's conformity.
On failure, throws an ex-info with a reason and data about any partial success before the failure.
Variation of ensure-conforms that speculatively ensures norm are conformed to On success, returns a map with: :db the resulting database that conforms the the provided norms :result a vector of maps with values for :norm-name, :tx-index, and :tx-result for each transaction that improved the db's conformity. On failure, throws an ex-info with a reason and data about any partial success before the failure.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close