fukamachi / cl-dbi

Database independent interface for Common Lisp
202 stars 28 forks source link

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

Open TatriX opened 3 years ago

TatriX commented 3 years ago

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!

fukamachi commented 3 years ago

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

TatriX commented 3 years ago

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