X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=db-oracle%2Foracle-objects.lisp;h=d9ac4a877e0dd88ea9952b20521ec9aa5d8156e2;hb=87e483c1247899a7ad5fff2daf2ca0df0526a9e0;hp=23f22d7cf48fb759dc8cf5a2f9edf05d783d179b;hpb=7d50938ba2db52a713498e49aa1679deae6f0b6b;p=clsql.git diff --git a/db-oracle/oracle-objects.lisp b/db-oracle/oracle-objects.lisp index 23f22d7..d9ac4a8 100644 --- a/db-oracle/oracle-objects.lisp +++ b/db-oracle/oracle-objects.lisp @@ -1,4 +1,19 @@ -(in-package :clsql-oracle) +;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: oracle-objects.lisp +;;;; +;;;; $Id$ +;;;; +;;;; This file is part of CLSQL. +;;;; +;;;; CLSQL users are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser GNU Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. +;;;; ************************************************************************* + +(in-package #:clsql-oracle) (defparameter *oracle-default-varchar2-length* "512") @@ -54,37 +69,38 @@ (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)) - (declare (ignore type database)) ;;(format t "value is \"~A\" of type ~A~%" val (type-of val)) + (declare (ignore type)) (etypecase val (string (read-from-string val)) (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)) - (declare (ignore database)) val) (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-sys::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-sys::database-get-type-specifier - ((type (eql 'local-time::duration)) +(defmethod database-get-type-specifier + ((type (eql 'duration)) args (database oracle-database)) (declare (ignore args))