From: Russ Tyndall Date: Mon, 14 Dec 2009 23:05:07 +0000 (-0500) Subject: added reset-command-object to allow using the same command against multiple connections X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=f6651e31a95d4df2481ebaca270d35fa16b6be13;hp=1b0508ae2a7b61334494d29571fcbb05825daf5e added reset-command-object to allow using the same command against multiple connections --- diff --git a/sql/command-object.lisp b/sql/command-object.lisp index c7b0ae5..1a9cc3e 100644 --- a/sql/command-object.lisp +++ b/sql/command-object.lisp @@ -32,12 +32,18 @@ :documentation "Have we already prepared this command object") )) +(defun reset-command-object (co) + "Resets the command object to have no name and to be unprepared + (This is useful if you want to run a command against a second database)" + (setf (prepared-name co) "" + (has-been-prepared co) nil)) + (defun command-object (expression &optional parameters (prepared-name "")) (make-instance 'command-object :expression expression :parameters parameters :prepared-name prepared-name)) -(export '(expression parameters prepared-name has-been-prepared command-object)) +(export '(expression parameters prepared-name has-been-prepared command-object reset-command-object))