Liking cljdoc? Tell your friends :D

stowaway.core


register-strategyclj

(register-strategy f)

Registers a data storage stragey so that it can be used in an application.

The single argument is a function that will be called and given the configuration for the storage strategy. If the strategy is able to initialize itself with the given configuration, it returns the reified strategy. Otherwise it returns nil.

Registers a data storage stragey so that it can be
used in an application.

The single argument is a function that will be
called and given the configuration for the storage
strategy. If the strategy is able to initialize itself
with the given configuration, it returns the reified
strategy. Otherwise it returns nil.
sourceraw docstring

reify-storageclj

(reify-storage config)

Searches registered strategies for one that is able to initialize itself with the given confiration.

If the given configuration implements Storage, it is returned. This allows a method that expects a storage configuration to receive a reified storage strategy also.

Searches registered strategies for one that is able to initialize itself
with the given confiration.

If the given configuration implements Storage, it is returned. This
allows a method that expects a storage configuration to receive a
reified storage strategy also.
sourceraw docstring

Storagecljprotocol

This protocol defines the abstract CRUD operations to be used by the application. This abstraction can be implemented by whatever specific storage you want to use.

This protocol defines the abstract CRUD operations to be used
by the application. This abstraction can be implemented by whatever
specific storage you want to use.

createclj

(create this model)

Creates a new model record

Creates a new model record

deleteclj

(delete this model)

Deletes the specified model record

Deletes the specified model record

delete-byclj

(delete-by this criteria)

Delete all models matching the specified criteria

Delete all models matching the specified criteria

selectclj

(select this criteria options)

Selects model records matching the specified criteria

Selects model records matching the specified criteria

updateclj

(update this model)
(update this attr criteria)

Given two args, updates the specified model. Given three arguments, applies the specified attributes to records matching the specified criteria.

Given two args, updates the specified model. Given three arguments,
applies the specified attributes to records matching the specified
criteria.

with-transactionclj

(with-transaction this func)

Executes the specified function which expects a single argument, which is a transacted storage instance

Executes the specified function which expects a single argument,
which is a transacted storage instance
sourceraw docstring

tagclj

(tag model)
(tag model model-type)

Given two arguments returns the first argument (the model) with updated metadata that can be used to determine how the model should be stored.

Given one argument, returns the type identifier from the metadata.

If the model already has a tag, and that tag is different that the second argument, a warning is written to the log.

Given two arguments returns the first argument (the model) with
updated metadata that can be used to determine how the model
should be stored.

Given one argument, returns the type identifier from the metadata.

If the model already has a tag, and that tag is different that the
second argument, a warning is written to the log.
sourceraw docstring

tagged?clj

(tagged? model model-type)

Returns true if the specified model is tagged with the specified value.

Returns true if the specified model is tagged
with the specified value.
sourceraw docstring

with-storagecljmacro

(with-storage binding & body)

Binds a reified storage strategy to the specified var.

(with-storage [stg config] (storage/update stg my-model))

Binds a reified storage strategy to the
specified var.

(with-storage [stg config]
  (storage/update stg my-model))
sourceraw docstring

with-transacted-storagecljmacro

(with-transacted-storage binding & body)

Evaluates the body in the context of a transaction using the configured storage mechanism. (transacted-storage [trns config] (storage/update trns my-first-model) (storage/update trns my-other-model)))

Evaluates the body in the context of a transaction using the configured
storage mechanism.
(transacted-storage [trns config]
  (storage/update trns my-first-model)
  (storage/update trns my-other-model)))
sourceraw docstring

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

× close