Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some required changes for CLSQL to work under Lispworks 7. #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions sql/ooddl.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,21 @@
(unless (slot-boundp instance slot-name)
(let ((*db-deserializing* t))
(cond
((join-slot-p slot-def)
((join-slot-p slot-object)
(setf (slot-value instance slot-name)
(if (view-database instance)
(fault-join-slot class instance slot-object)
;; TODO: you could in theory get a join object even if
;; its joined-to object was not in the database
nil
)))
((not-direct-normalized-slot-p class slot-def)
((not-direct-normalized-slot-p class slot-object)
(if (view-database instance)
(update-fault-join-normalized-slot class instance slot-def)
(update-fault-join-normalized-slot class instance slot-object)
(setf (slot-value instance slot-name) nil))))))))
(call-next-method))


(defmethod (setf slot-value-using-class) (new-value (class standard-db-class)
instance slot-def)
"Handle auto syncing values to the database if *db-auto-sync* is t"
Expand Down Expand Up @@ -236,13 +237,14 @@ option specifies the value to store if the SQL value is NULL and
defaults to NIL. The :db-constraints slot option is a string
representing an SQL table constraint expression or a list of such
strings."
`(progn
(defclass ,class ,supers ,slots
,@(if (find :metaclass `,cl-options :key #'car)
`,cl-options
(cons '(:metaclass clsql-sys::standard-db-class) `,cl-options)))
(finalize-inheritance (find-class ',class))
(find-class ',class)))
(let ((cl-options `(#+lispworks (:optimize-slot-access nil) ,@cl-options)))
`(progn
(defclass ,class ,supers ,slots
,@(if (find :metaclass `,cl-options :key #'car)
`,cl-options
(cons '(:metaclass clsql-sys::standard-db-class) `,cl-options)))
(finalize-inheritance (find-class ',class))
(find-class ',class))))

(defun keyslots-for-class (class)
(slot-value class 'key-slots))
4 changes: 2 additions & 2 deletions sql/utils.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@

#+lispworks
(defvar +lw-has-without-preemption+
#+lispworks6 nil
#-lispworks6 t)
#-(or lispworks5 lispworks4) nil
#+(or lispworks5 lispworks4) t)
#+lispworks
(defvar +lw-global-lock+
(unless +lw-has-without-preemption+
Expand Down