Add support for :default in db constraints. make-constraint-description: use next...
[clsql.git] / sql / oodml.lisp
index b6f4b417185961e6c3eefac98bf346bbcf13eee9..0ddaabad5d5444eda23851945f018cf7d9a3bd67 100644 (file)
                        (slot-definition s))
             when (sstoredp sd)
               collect sd))
+      ;; handle slots with defaults
+      (dolist (slot slots)
+       (when (and (slot-exists-p slot 'db-constraints)
+                  (listp (view-class-slot-db-constraints slot))
+                  (member :default (view-class-slot-db-constraints slot)))
+         (update-slot-from-record obj (slot-definition-name slot))))
       ;;this may just be a NOP.
       (setf (slot-value obj 'view-database) database)))