X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Fcommand-object.lisp;h=f6c57693dbb5c9db6eea7ddee51012696f488aae;hb=6828cb461404126aa0c334fe2b669d435304f73e;hp=1a9cc3e6edd159d2cdfe82957a053ff6a12c4121;hpb=f6651e31a95d4df2481ebaca270d35fa16b6be13;p=clsql.git diff --git a/sql/command-object.lisp b/sql/command-object.lisp index 1a9cc3e..f6c5769 100644 --- a/sql/command-object.lisp +++ b/sql/command-object.lisp @@ -32,6 +32,19 @@ :documentation "Have we already prepared this command object") )) +(defmethod initialize-instance :after ((o command-object) &key &allow-other-keys ) + ;; Inits parameter nulls + (setf (parameters o) (parameters o))) + +(defmethod (setf parameters) (new (o command-object)) + " This causes the semantics to match cl-sql instead of cl-postgresql + " + (setf (slot-value o 'parameters) + (loop for p in (parameters o) + collect (cond ((null p) :null) + ((member p (list :false :F)) nil) + (T p))))) + (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)"