cl-2sql

Lisp to SQL compiler for Common Lisp
git clone https://logand.com/git/cl-2sql.git/
Log | Files | Refs | README | LICENSE

commit 5aac1699239579f6ccca31420cfa6b799b084e41
parent d90278c8922f374dfcf62f1a478996b1bb316b38
Author: Tomas Hlavaty <tom@logand.com>
Date:   Tue,  6 Sep 2011 22:42:38 +0200

update database when setf persistent slot

Diffstat:
Morm.lisp | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/orm.lisp b/orm.lisp @@ -226,7 +226,14 @@ (a %persistent-object) slotd) ;; TODO ? enforce assert-type? - (call-next-method)) + (let ((x (call-next-method))) + (unless *initializing-instance* + (let ((oid (oid a))) + (2sql:query (oid value) + `(q:update ,(class-name class) + ((,(pslot-name slotd) (q:qvar value))) + (q:where (q:= oid (q:qvar oid))))))) + x)) ;;; persistent slots