fixed a bug where it was ignoring the new parameters passed in on a setf-er
[clsql.git] / sql / command-object.lisp
index 1a9cc3e6edd159d2cdfe82957a053ff6a12c4121..566a2fea293b6693225af28e7034ed9d06c1441b 100644 (file)
                      :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 new
+             collecting (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)"