X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=db-oracle%2Foracle-objects.lisp;h=581f7f9e2f6382b35d381c75383b37c5d7ba0d41;hb=214df89281860c871c99371a2b5582ff0b602205;hp=6740f94bddfcc625a5828362c9b12bf98db0f320;hpb=7cf55152a361b4cc7666ccc4514afd00eae43007;p=clsql.git diff --git a/db-oracle/oracle-objects.lisp b/db-oracle/oracle-objects.lisp index 6740f94..581f7f9 100644 --- a/db-oracle/oracle-objects.lisp +++ b/db-oracle/oracle-objects.lisp @@ -2,7 +2,7 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: oracle-objects.lisp +;;;; Name: oracle-objects.lisp ;;;; ;;;; $Id$ ;;;; @@ -22,8 +22,14 @@ (declare (ignore type args)) (concatenate 'string "VARCHAR2(" *oracle-default-varchar2-length* ")")) +(defmethod database-get-type-specifier ((type (eql 'integer)) args (database oracle-database)) + (if args + (format nil "NUMBER(~A,~A)" + (or (first args) 38) (or (second args) 0)) + "INTEGER")) + (defmethod database-get-type-specifier - ((type (eql 'integer)) args (database oracle-database)) + ((type (eql 'bigint)) args (database oracle-database)) (if args (format nil "NUMBER(~A,~A)" (or (first args) 38) (or (second args) 0)) @@ -69,6 +75,11 @@ (or (first args) 38) (or (second args) 38)) "NUMBER")) +(defmethod database-get-type-specifier + ((type (eql 'boolean)) args (database oracle-database)) + (declare (ignore args)) + "CHAR(1)") + (defmethod read-sql-value (val type (database oracle-database)) ;;(format t "value is \"~A\" of type ~A~%" val (type-of val)) (declare (ignore type)) @@ -78,10 +89,6 @@ (symbol nil))) -(defmethod read-sql-value (val (type (eql 'string)) database) - (declare (ignore database)) - val) - (defmethod read-sql-value (val (type (eql 'integer)) (database oracle-database)) val) @@ -89,16 +96,17 @@ (defmethod read-sql-value (val (type (eql 'float)) (database oracle-database)) val) -;;; LOCAL-TIME stuff that needs to go into hooks -#+local-time -(defmethod clsql::database-get-type-specifier - ((type (eql 'local-time::local-time)) args (database oracle-database)) +(defmethod read-sql-value (val (type (eql 'boolean)) (database oracle-database)) + (when (char-equal #\t (schar val 0)) + t)) + +(defmethod database-get-type-specifier + ((type (eql 'wall-time)) args (database oracle-database)) (declare (ignore args)) "DATE") -#+local-time -(defmethod clsql::database-get-type-specifier - ((type (eql 'local-time::duration)) +(defmethod database-get-type-specifier + ((type (eql 'duration)) args (database oracle-database)) (declare (ignore args))