(:file "datasets")
(:file "ds-employees")
(:file "ds-nodes")
+ (:file "ds-artists")
(:file "benchmarks")
(:file "test-internal")
(:file "test-basic")
(:file "test-ooddl")
(:file "test-oodml")
(:file "test-syntax")
- #-uffi:no-i18n (:file "test-i18n")
+ ; #-uffi:no-i18n (:file "test-i18n")
))))
(defmethod perform ((o test-op) (c (eql (find-system 'clsql-tests))))
--- /dev/null
+(in-package #:clsql-tests)
+
+#.(clsql:locally-enable-sql-reader-syntax)
+
+(defparameter artist1 nil)
+
+(def-view-class artist ()
+ ((artist_id :accessor artist_id :initarg :id
+ :type integer :db-kind :key :db-constraints (:not-null :auto-increment)
+ :autoincrement-sequence 'artist_artist_id_seq)
+ (name :accessor name :initarg :name :type (varchar 20))))
+
+(defun initialize-ds-artists ()
+ ; (start-sql-recording :type :both)
+ ; (let ((*backend-warning-behavior*
+ ; (if (member *test-database-type* '(:postgresql :postgresql-socket))
+ ; :ignore
+ ; :warn)))
+ (mapc #'clsql:create-view-from-class
+ '(artist))
+
+ (setq *test-start-utime* (get-universal-time))
+ (let* ((*db-auto-sync* nil))
+ (setf artist1 (make-instance 'artist
+ :name "Mogwai"))))
+
+(def-dataset *ds-artists*
+ (:setup initialize-ds-artists)
+ (:cleanup (lambda ()
+ (mapc #'clsql-sys:drop-view-from-class
+ '(artist))
+ (ignore-errors
+ (mapc #'clsql-sys:drop-sequence
+ (list "artist_artist_id_seq"))))))
+
+#.(clsql:restore-sql-reader-syntax-state)
(clsql-sys:in test :oodml/select/12 :oodml/select/13 :oodml/select/14
:oodml/select/15 :oodml/select/16 :oodml/select/17
:oodml/select/18 :oodml/select/19 :oodml/select/20
- :oodml/select/21 :oodml/select/22
+ :oodml/select/21 :oodml/select/22 :oodml/select/23
:oodml/update-records/4 :oodml/update-records/4-slots
:oodml/update-records/5 :oodml/update-records/5-slots
:oodml/update-records/6 :oodml/update-records/7
:oodml/update-records/8 :oodml/update-records/9
- :oodml/update-records/9-slots :oodml/update-instance/3
+ :oodml/update-records/9-slots :oodml/update-records/10
+ :oodml/update-records/11 :oodml/update-instance/3
:oodml/update-instance/4 :oodml/update-instance/5
:oodml/update-instance/6 :oodml/update-instance/7
:oodml/db-auto-sync/3 :oodml/db-auto-sync/4))
(slot-value a 'loc))))
10 10 "subloc-1" "a subloc")
+(deftest :oodml/select/23
+ (with-dataset *ds-artists*
+ (length (clsql:select 'artist :flatp t :caching nil)))
+ 0)
+
;; test retrieval is deferred
(deftest :oodm/retrieval/1
(with-dataset *ds-employees*
((42.0d0))
((24.13d0)))
+(deftest :oodml/update-records/11
+ (with-dataset *ds-artists*
+ (clsql:update-records-from-instance artist1)
+ (list (name artist1) (artist_id artist1)))
+ ("Mogwai" 1))
;; tests update-instance-from-records
(deftest :oodml/update-instance/1