X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Foodml.lisp;h=187694dcacb5011d28b6900ffd186f0d20e058af;hp=aebadfa27b31346c0e1294f190cd7b669eb991c0;hb=fc58e4fb7d908985389c86adf57ddee6c1dde5d2;hpb=c3e3e19b61caa55bae90f76f957591259fa3b5f1 diff --git a/sql/oodml.lisp b/sql/oodml.lisp index aebadfa..187694d 100644 --- a/sql/oodml.lisp +++ b/sql/oodml.lisp @@ -130,7 +130,7 @@ (dbtype (specified-type slotdef))) (typecase dbwriter (string (format nil dbwriter val)) - ((or symbol function) (apply dbwriter (list val))) + ((and (or symbol function) (not null)) (apply dbwriter (list val))) (t (database-output-sql-as-type (typecase dbtype @@ -381,6 +381,10 @@ (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") @@ -584,6 +588,11 @@ (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)