+26 May 2004 Kevin Rosenberg <kevin@rosenberg.net>
+ * sql/oodml.lisp: Commit universal-time typo patch from Edi Weitz
+ * test/test-init.lisp: Add universal-time slot to person.
+ * test/test-fddl.lisp: Add tests of universal-time slot
+ * test/test-ooddl.lisp: Test universal-time slot in an object
+ * TODO: Remove need for universal-time test
+ * debian/rules, debian/control: Add cl-sql-oracle binary package
+
25 May 2004 Kevin Rosenberg <kevin@rosenberg.net>
* sql/oodml.lisp: (string n) now produces a CHAR field. Add new VARCHAR
type. Added *default-varchar-length* rather than previous hard-coded
* :db-constraint tests
* test *db-auto-sync*
* for-each-row macro
-* universal-time
* owner phrases for postgresql and oracle backends
* Number and Char field types
* New upstream
* Add cl-sql-oracle binary package
- -- Kevin M. Rosenberg <kmr@debian.org> Wed, 26 May 2004 09:10:12 -0600
+ -- Kevin M. Rosenberg <kmr@debian.org> Thu, 27 May 2004 04:47:27 -0600
cl-sql (2.11.1-1) unstable; urgency=low
Provides: cl-sql-backend
Description: CLSQL database backend, Oracle
This package enables you to use the CLSQL data access package
- with Oracle databases. This package requires the Oracle Instant
- Client libraries to operate.
+ with Oracle databases.
CLSQL is a Common Lisp interface to SQL databases.
Package: cl-sql-tests
(read-from-string val)))
(number val)))
-(defmethod read-sql-value (val (type (eql 'univeral-time)) database db-type)
+(defmethod read-sql-value (val (type (eql 'universal-time)) database db-type)
(declare (ignore database db-type))
(unless (eq 'NULL val)
(etypecase val
(clsql:list-attributes [employee]
:owner *test-database-user*))
#'string<))
- "birthday" "ecompanyid" "email" "emplid" "first_name" "groupid" "height"
+ "bd_utime" "birthday" "ecompanyid" "email" "emplid" "first_name" "groupid" "height"
"last_name" "managerid" "married")
(deftest :fddl/attributes/2
(clsql:list-attribute-types [employee]
:owner *test-database-user*))
#'string<))
- "birthday" "ecompanyid" "email" "emplid" "first_name" "groupid" "height"
+ "bd_utime" "birthday" "ecompanyid" "email" "emplid" "first_name" "groupid" "height"
"last_name" "managerid" "married")
;; Attribute types are vendor specific so need to test a range
(and (member (clsql:attribute-type [height] [employee]) '(:float :float8 :number)) t)
t)
+(deftest :fddl/attributes/7
+ (and (member (clsql:attribute-type [bd_utime] [employee]) '(:bigint :int8 :number)) t)
+ t)
;; create a view, test for existence, drop it and test again
;; inserts a record using all values only and then deletes it
(deftest :fdml/insert/1
- (progn
+ (let ((now (get-universal-time)))
(clsql:insert-records :into [employee]
- :values `(11 1 "Yuri" "Gagarin" "gagarin@soviet.org"
- 1 1 1.85 t ,(clsql:get-time)))
+ :values `(11 1 "Yuri" "Gagarin" "gagarin@soviet.org"
+ 1 1 1.85 t ,(clsql:utime->time now) ,now))
(values
(clsql:select [first-name] [last-name] [email]
:from [employee] :where [= [emplid] 11])
(defvar *test-database-type* nil)
(defvar *test-database-underlying-type* nil)
(defvar *test-database-user* nil)
+(defvar *test-start-utime* nil)
(defclass thing ()
((extraterrestrial :initform nil :initarg :extraterrestrial)))
(married :db-kind :base :accessor married :type boolean
:initarg :married)
(birthday :type clsql:wall-time :initarg :birthday)
+ (bd-utime :type clsql:universal-time :initarg :bd-utime)
(hobby :db-kind :virtual :initarg :hobby :initform nil)))
(def-view-class employee (person)
(clsql:create-view-from-class 'employee-address)
(clsql:create-view-from-class 'big))
- (let ((*db-auto-sync* t))
+ (setq *test-start-utime* (get-universal-time))
+ (let* ((*db-auto-sync* t)
+ (now-time (clsql:utime->time *test-start-utime*)))
(setf company1 (make-instance 'company
:presidentid 1
:companyid 1
:groupid 1
:married t
:height (1+ (random 1.00))
- :birthday (clsql:get-time)
+ :bd-utime *test-start-utime*
+ :birthday now-time
:first-name "Vladamir"
:last-name "Lenin"
:email "lenin@soviet.org"
:groupid 1
:height (1+ (random 1.00))
:married t
- :birthday (clsql:get-time)
+ :bd-utime *test-start-utime*
+ :birthday now-time
:first-name "Josef"
:last-name "Stalin"
:email "stalin@soviet.org"
:groupid 1
:height (1+ (random 1.00))
:married t
- :birthday (clsql:get-time)
+ :bd-utime *test-start-utime*
+ :birthday now-time
:first-name "Leon"
:last-name "Trotsky"
:email "trotsky@soviet.org"
:groupid 1
:height (1+ (random 1.00))
:married nil
- :birthday (clsql:get-time)
+ :bd-utime *test-start-utime*
+ :birthday now-time
:first-name "Nikita"
:last-name "Kruschev"
:email "kruschev@soviet.org"
:groupid 1
:married nil
:height (1+ (random 1.00))
- :birthday (clsql:get-time)
+ :bd-utime *test-start-utime*
+ :birthday now-time
:first-name "Leonid"
:last-name "Brezhnev"
:email "brezhnev@soviet.org"
:groupid 1
:married nil
:height (1+ (random 1.00))
- :birthday (clsql:get-time)
+ :bd-utime *test-start-utime*
+ :birthday now-time
:first-name "Yuri"
:last-name "Andropov"
:email "andropov@soviet.org"
:groupid 1
:height (1+ (random 1.00))
:married nil
- :birthday (clsql:get-time)
+ :bd-utime *test-start-utime*
+ :birthday now-time
:first-name "Konstantin"
:last-name "Chernenko"
:email "chernenko@soviet.org"
:groupid 1
:height (1+ (random 1.00))
:married nil
- :birthday (clsql:get-time)
+ :bd-utime *test-start-utime*
+ :birthday now-time
:first-name "Mikhail"
:last-name "Gorbachev"
:email "gorbachev@soviet.org"
:groupid 1
:married nil
:height (1+ (random 1.00))
- :birthday (clsql:get-time)
+ :bd-utime *test-start-utime*
+ :birthday now-time
:first-name "Boris"
:last-name "Yeltsin"
:email "yeltsin@soviet.org"
:groupid 1
:married nil
:height (1+ (random 1.00))
- :birthday (clsql:get-time)
+ :bd-utime *test-start-utime*
+ :birthday now-time
:first-name "Vladamir"
:last-name "Putin"
:email "putin@soviet.org"
fail-index)
-1)
+(deftest :ooddl/time/3
+ (progn
+ (when (member *test-database-underlying-type* '(:postgresql :postgresql-socket))
+ (clsql:execute-command "set datestyle to 'iso'"))
+ (let ((dbobj (car (clsql:select 'employee :where [= [emplid] 10]
+ :flatp t))))
+ (list
+ (eql *test-start-utime* (slot-value dbobj 'bd-utime))
+ (clsql:time= (slot-value dbobj 'birthday)
+ (clsql:utime->time (slot-value dbobj 'bd-utime))))))
+ (t t))
+
))
#.(clsql:restore-sql-reader-syntax-state)