Liking cljdoc? Tell your friends :D

bf.crud.db


delete!clj

(delete! db entity)
(delete! db entity where-clause)
source

empty-recordclj

(empty-record this)

Same a c.c/empty, but work on records. An empty record is a record with all fields initialized to nil

Same a c.c/empty, but work on records. An empty record is a record with all
fields initialized to `nil`
sourceraw docstring

fetch!clj

(fetch! db entity)
(fetch! db entity where-clause & {:keys [opts]})
source

generate-strict-where-from-entityclj

(generate-strict-where-from-entity entity)

Generate a where clause from entity, preserving nils value for primary-keys.

Generate a where clause from entity, preserving nils value for primary-keys.
sourceraw docstring

generate-where-from-entityclj

(generate-where-from-entity entity)

Generate a where clause from an entity, ignore nil values for primary keys.

Generate a where clause from an entity, ignore nil values for primary keys.
sourceraw docstring

generated-pkclj

(generated-pk rs-item)

Return the generated primary key of resultset item

Return the generated primary key of resultset item
sourceraw docstring

insert-multi!clj

(insert-multi! db entities & {:keys [opts]})
source

invoke-record-constructorclj

(invoke-record-constructor this amap)

For a record instance, invoke the auto-generated map->Record factory function.

For a record instance, invoke the auto-generated map->Record factory function.
sourceraw docstring

prepare-multi-rowsclj

(prepare-multi-rows db table rows)
source

query!clj

(query! db entity query-vec & {:keys [opts]})
source

query-rawclj

(query-raw db query-vec & {:keys [opts]})
source

recover-entitiesclj

(recover-entities db entity resultset)

Take a db-spec, entity, a resultset and will re-fetch all resultset items from db. If no primary key are available, return the resultset.

Take a db-spec, entity, a resultset and will re-fetch all resultset items from
db. If no primary key are available, return the resultset.
sourceraw docstring

remove-nilsclj

(remove-nils amap)
source

renewclj

(renew entity map)
source

row-fnclj

(row-fn row)
source

save!clj

(save! db entity & {:keys [opts]})

Save a map or a coll of maps in the given table, only save keys matching existing columns.

Save a map or a coll of maps in the given table, only save keys matching
existing columns.
sourceraw docstring

save-subentities!clj

(save-subentities! db entity subentities relation-key getterf)

Upsert and/or delete the designated subentities in db, implementing the save operation on a one-to-many relationship. Take a db spec, an entity, a key designating a slot of related subentities, a relation-key keyword naming the reference from the subentity to the entity, and a 2 arity getterf function. Will use getterf, passing it db and entity to find the actual subentities in db, diff them agains the given subentities and perform 2 actions in this order: save in db all given subentities setting their relation-key to the entity's primary-key, then delete from db the ones present in db but not in subentities. Example: (save-subentities! db user :posts :user-id posts/find-by-user)

Upsert and/or delete the designated `subentities` in `db`, implementing the
save operation on a one-to-many relationship. Take a `db` spec, an `entity`, a
key designating a slot of related `subentities`, a `relation-key` keyword
naming the reference from the subentity to the entity, and a 2 arity `getterf`
function. Will use `getterf`, passing it `db` and `entity` to find the actual
subentities in `db`, diff them agains the given `subentities` and perform 2
actions in this order: save in `db` all given `subentities` setting their
`relation-key` to the entity's primary-key, then delete from `db` the ones
present in `db` but not in `subentities`.
Example: (save-subentities! db user :posts :user-id posts/find-by-user)
sourceraw docstring

standard-genkeysclj

source

update!clj

(update! db entity query-clause & {:keys [opts]})
source

upsert!clj

(upsert! db table entity & {:keys [opts]})
source

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

× close