Skip to content
Snippets Groups Projects
Commit c29fb53f authored by Cam Saul's avatar Cam Saul
Browse files

`sel :one` adds korma `(limit 1)` form to `select` call

parent 5807557d
Branches
Tags
No related merge requests found
......@@ -143,7 +143,7 @@
(sel :many Table :db_id 1 (order :name :ASC)) -> (select User (where {:id 1}) (order :name ASC))"
[one-or-many entity & forms]
{:pre [(contains? #{:one :many} one-or-many)]}
`(->> (-sel-select ~entity ~@forms)
`(->> (-sel-select ~entity ~@forms ~@(when (= one-or-many :one) `((limit 1))))
(map (partial post-select (entity->korma ~entity)))
~(case one-or-many
:one 'first
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment