Plaster
New
List
Login
common-lisp
default
Old Sock
2019.03.08 02:08:40
(defmacro def-return-where (column &optional (table :sql-users)) "Generates a defun whose name is 'return-where-<name>=', this generated function searches the table for entries where '<column=> = column=. e.g '(def-return-where id) '(DEFUN RETURN-WHERE-ID= (ID) '(QUERY (:SELECT :* :FROM :SQL-USERS :WHERE (:= 'ID ID))))" `(defun ,(intern (concatenate 'string (symbol-name 'return-where-) (symbol-name column) "=")) (,column) (query (:select :* :from ,table :where (:= ',column ,column)))))
Raw
Annotate
Repaste