Using sql-expression causes issues when id column doesn't exist in sql
table, but rather, id slot points to actual column. so it's better to
let clsql build correct expression:

diff -r 206d7912f81a src/store/clsql/clsql.lisp
--- a/src/store/clsql/clsql.lisp        Mon Nov 15 23:53:14 2010 -0500
+++ b/src/store/clsql/clsql.lisp        Thu Dec 02 11:22:17 2010 -0500
@@ -153,18 +153,19 @@
 (defmethod find-persistent-object-by-id ((store database) class-name
object-id)

   #.(locally-enable-sql-reader-syntax)
   (car (select class-name
-              :where [= (sql-expression :attribute (class-id-slot-
name class-name))
+               :where [= [slot-value class-name (class-id-slot-name
class-name)]
                         object-id]
               :flatp t :caching nil :database store))
   #.(restore-sql-reader-syntax-state))

-- 
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en.

Reply via email to