From: Russ Tyndall Date: Thu, 14 May 2009 17:27:38 +0000 (-0400) Subject: Update-slots-from-instance now throws an exception if it generates an update without... X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=106b55bc15b5118cd328e3ebb6f5f67db3b26206 Update-slots-from-instance now throws an exception if it generates an update without a where clause --- diff --git a/sql/oodml.lisp b/sql/oodml.lisp index 3e7ec9a..8eec40e 100644 --- a/sql/oodml.lisp +++ b/sql/oodml.lisp @@ -189,11 +189,14 @@ (db-value-from-slot slot val database)))) slots))) (cond ((and avps (view-database obj)) - (update-records (sql-expression :table vct) - :av-pairs avps - :where (key-qualifier-for-instance - obj :database database) - :database database)) + (let ((where (key-qualifier-for-instance + obj :database database))) + (unless where + (error "update-record-from-slots: Could not generate a where clause for this object: ~a" obj)) + (update-records (sql-expression :table vct) + :av-pairs avps + :where where + :database database))) ((and avps (not (view-database obj))) (insert-records :into (sql-expression :table vct) :av-pairs avps