((typep slot-reader 'string)
(setf (slot-value instance slot-name)
(format nil slot-reader value)))
- ((typep slot-reader 'function)
+ ((typep slot-reader '(or symbol function))
(setf (slot-value instance slot-name)
(apply slot-reader (list value))))
(t
nil)
((typep slot-reader 'string)
(format nil slot-reader value))
- ((typep slot-reader 'function)
+ ((typep slot-reader '(or symbol function))
(apply slot-reader (list value)))
(t
(error "Slot reader is of an unusual type.")))))
(dbtype (specified-type slotdef)))
(typecase dbwriter
(string (format nil dbwriter val))
- (function (apply dbwriter (list val)))
+ ((and (or symbol function) (not null)) (apply dbwriter (list val)))
(t
(database-output-sql-as-type
(typecase dbtype
(declare (ignore args database db-type))
"TIMESTAMP")
+(defmethod database-get-type-specifier ((type (eql 'date)) args database db-type)
+ (declare (ignore args database db-type))
+ "DATE")
+
(defmethod database-get-type-specifier ((type (eql 'duration)) args database db-type)
(declare (ignore database args db-type))
"VARCHAR")
(unless (eq 'NULL val)
(parse-timestring val)))
+(defmethod read-sql-value (val (type (eql 'date)) database db-type)
+ (declare (ignore database db-type))
+ (unless (eq 'NULL val)
+ (parse-datestring val)))
+
(defmethod read-sql-value (val (type (eql 'duration)) database db-type)
(declare (ignore database db-type))
(unless (or (eq 'NULL val)