Skip to content

Commit

Permalink
added list-of-db-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbysmith007 committed Jul 29, 2013
1 parent aeca964 commit 6910991
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clsql-helper.asd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(:file "migrations"))
:depends-on (:iterate :clsql :closer-mop :cl-ppcre
:cl-interpol :symbol-munger :alexandria
:md5 :access))
:md5 :access :collectors))

(defsystem :clsql-helper-test
:description "Tests for a library providing a clutch of utilities to make
Expand Down
7 changes: 7 additions & 0 deletions clsql.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@
(when s
#?"'${prefix}${wrapper}${(clsql-sys:sql-escape-quotes s)}${wrapper}${postfix}'")))

(defun list-of-db-strings (list)
"For use in creating `column IN (${stuff})` type of clauses"
(when list
(collectors:with-string-builder-output (out :delimiter ", ")
(iter (for i in (alexandria:ensure-list list))
(out (db-string i))))))

(defun %clsql-subclauses (clauses)
(iter (for c in clauses)
(when c
Expand Down
2 changes: 1 addition & 1 deletion package.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

;; rest
#:join-slot?
#:clsql-get-val #:clsql-exp #:db-string
#:clsql-get-val #:clsql-exp #:db-string #:list-of-db-strings
#:clsql-ands #:clsql-and
#:clsql-ors #:clsql-or
#:clsql-column-name
Expand Down

0 comments on commit 6910991

Please sign in to comment.