Name

*DB-AUTO-SYNC* — Enables SQL storage during Lisp object creation.Variable

Value Type

Boolean

Initial Value

NIL

Description

When this variable is T an instance is stored in the SQL database when the instance is created by make-instance. Furthermore, the appropriate database records are updated whenever the slots of a View Class instance are modified.

When this variable is NIL, which is the default value, CLSQL behaves like CommonSQL: instances of view classes are stored or updated in the SQL database only when update-record-from-instance, update-record-from-slot or update-record-from-slots are called.

Examples

	(let ((instance (make-instance 'foo)))
	  (update-records-from-instance instance))

	;; is equivalent to

	(let ((*db-auto-sync* t))
	  (make-instance 'foo))
          
        ;; and 

        (progn 
          (setf (slot-value instance 'bar) "baz")
          (update-record-from-slot instance 'bar))

        ;; is equivalent to 

        (let ((*db-auto-sync* t))
          (setf (slot-value instance 'bar) "baz"))
      

Affected By

None.

See Also

update-records-from-instance
update-record-from-slot
update-record-from-slots

Notes

This is a CLSQL extension to the CommonSQL API.