(default-connectable model)
The default connectable that should be used when executing queries for model
if
no toucan2.connection/*current-connectable*
is currently bound. By default, this just returns the global default
connectable, :default
, but you can tell Toucan to use a different default connectable for a model by implementing
this method.
The default connectable that should be used when executing queries for `model` if no [[toucan2.connection/*current-connectable*]] is currently bound. By default, this just returns the global default connectable, `:default`, but you can tell Toucan to use a different default connectable for a model by implementing this method.
(primary-key-values instance)
(primary-key-values model m)
Return a map of primary key values for a Toucan 2 instance
.
Return a map of primary key values for a Toucan 2 `instance`.
(primary-keys model)
Return a sequence of the primary key columns names, as keywords, for a model.
Return a sequence of the primary key columns names, as keywords, for a model.
(primary-keys-vec model)
Get the primary keys for a model
as a vector.
Get the primary keys for a `model` as a vector.
(select-pks-fn modelable)
Return a function to get the value(s) of the primary key(s) from a row. Used by toucan2.select/select-pks-reducible
and thus by toucan2.select/select-pks-set
, toucan2.select/select-pks-vec
, etc.
The primary keys are determined by toucan2.model/primary-keys
. By default this is simply the keyword :id
.
Return a function to get the value(s) of the primary key(s) from a row. Used by [[toucan2.select/select-pks-reducible]] and thus by [[toucan2.select/select-pks-set]], [[toucan2.select/select-pks-vec]], etc. The primary keys are determined by [[toucan2.model/primary-keys]]. By default this is simply the keyword `:id`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close