Helper functions for working with datomic entities.
Transaction results are put in :result
in the liberator context.
Helper functions for working with datomic entities. Transaction results are put in `:result` in the liberator context.
(auth-owns? ctx db user-key & [id-key])
Check if the user entity is the same as the authenticated user
Check if the user entity is the same as the authenticated user
(create ctx)
transact the params in a context
transact the params in a context
(created-entity ctx)
Use when you've created a single entity and stored the tx result under :result
Use when you've created a single entity and stored the tx result under :result
(created-id {:keys [result]})
return id of created entity, assuming you've only created one entity
return id of created entity, assuming you've only created one entity
(created-pull ctx)
Differs from created-entity
in that it returns a map, not a
map-like Datomic Entity
Differs from `created-entity` in that it returns a map, not a map-like Datomic Entity
(ctx->create-map ctx)
given a liberator context, returns a map that's ready to be used in a datomic transaction to create an entity
given a liberator context, returns a map that's ready to be used in a datomic transaction to create an entity
(ctx->update-map ctx & [id-key])
cleans up params from liberator context
cleans up params from liberator context
(ctx-id ctx & [id-key])
Get id from the params, try to convert to number
Get id from the params, try to convert to number
(deref->:result tx)
deref a transaction and put the result in :result
of ctx.
deref a transaction and put the result in `:result` of ctx.
(updated-entity ctx)
Use when you've updated a single entity and stored the tx result under :result
Use when you've updated a single entity and stored the tx result under :result
(updated-pull ctx)
Differs from created-entity
in that it returns a map, not a
map-like Datomic Entity
Differs from `created-entity` in that it returns a map, not a map-like Datomic Entity
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close