Skip to content

Commit

Permalink
table#fetch returns only one instance if :first or number is specifie…
Browse files Browse the repository at this point in the history
…d as the second argument.
  • Loading branch information
fukamachi committed Feb 13, 2011
1 parent dac346f commit e3185aa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/table.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
(defun fetch (table ids-or-key &key where order offset limit group-by)
(etypecase ids-or-key
(keyword (ecase ids-or-key
(:first (select table :limit 1 :offset offset :flatp t))
(:first (car (select table :limit 1 :offset offset :flatp t)))
(:all (select table :flatp t))))
(number
(select table
:where
(if where
[and [= [id] ids-or-key] where]
[= [id] ids-or-key])
:flatp t))
(car (select table
:where
(if where
[and [= [id] ids-or-key] where]
[= [id] ids-or-key])
:flatp t)))
(cons (select table
:where
(if where
Expand Down

0 comments on commit e3185aa

Please sign in to comment.