r9811: * sql/oodml.lisp: add DATABASE-OUTPUT-SQL-AS-TYPE method specialisation
[clsql.git] / sql / oodml.lisp
index 624cadf059a1871fe4dc37c043a79aae6f75a71c..4562be8558eb43b0b79e2be50f58b2881052bfda 100644 (file)
   (declare (ignore database db-type))
   val)
 
-(defmethod database-output-sql-as-type ((type (eql 'char))
-                                       val database db-type)
+(defmethod database-output-sql-as-type ((type (eql 'char)) val database db-type)
   (declare (ignore database db-type))
   (etypecase val
     (character (write-to-string val))
     (string val)))
 
+(defmethod database-output-sql-as-type ((type (eql 'float)) val database db-type)
+  (declare (ignore database db-type))
+  (let ((*read-default-float-format* (type-of val)))
+    (format nil "~F" val)))
+
 (defmethod read-sql-value (val type database db-type)
   (declare (ignore type database db-type))
   (read-from-string val))