cl-dbi icon indicating copy to clipboard operation
cl-dbi copied to clipboard

Make ":binds" of "retrieve-by-sql" into an optional param

Open TatriX opened this issue 4 years ago • 2 comments
trafficstars

Hi! Looking at (defgeneric retrieve-by-sql (sql &key binds) it seems that :binds can be &optional instead of a key param:

(mito:retrieve-by-sql "select * from users where email = $1" :binds (list *default-email*))
;; vs
(mito:retrieve-by-sql "select * from users where email = $1" (list *default-email*))

Is there a specific reason for using :binds here instead of just an &optional (or &rest)?

Thanks!

TatriX avatar Jul 29 '21 12:07 TatriX

I'm not pretty sure, but perhaps to make it possible to add custom key arguments for child classes.

fukamachi avatar Aug 02 '21 00:08 fukamachi

What do you think about something like (defgeneric retreive-by-sql sql &optional binds &keys &allow-other-keys)?

TatriX avatar Aug 02 '21 07:08 TatriX