Skip to content

Commit

Permalink
Fixed bug when query or delete macros a not given conditions.
Browse files Browse the repository at this point in the history
  • Loading branch information
budu committed Apr 21, 2011
1 parent e107bfe commit 379ece1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lobos/internal.clj
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@

(defmacro query [db-spec sname tname & [conditions]]
`(query-from-where ~db-spec "select *" ~sname ~tname
(schema/expression ~conditions)))
(when-not ~(nil? conditions)
(schema/expression ~conditions))))

(defmacro delete [db-spec sname tname & [conditions]]
`(query-from-where ~db-spec "delete" ~sname ~tname
(schema/expression ~conditions)))
(when-not ~(nil? conditions)
(schema/expression ~conditions))))

0 comments on commit 379ece1

Please sign in to comment.