;; 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])
("1" "2" "3" "4"))
(deftest :fdml/select/21
- (clsql:select [substr [first-name] 1 4] :from [employee]
+ (clsql:select [substring [first-name] 1 4] :from [employee]
:flatp t :order-by [emplid] :field-names nil)
("Vlad" "Jose" "Leon" "Niki" "Leon" "Yuri" "Kons" "Mikh" "Bori" "Vlad"))
:flatp t)
results)
(apply #'values (nreverse results)))
- nil :committed nil ("lenin-nospam@soviet.org") :committed
- nil ("lenin@soviet.org"))
+ nil nil nil ("lenin-nospam@soviet.org") nil nil ("lenin@soviet.org"))
;; runs a valid update and an invalid one within a transaction and checks
;; that the valid update is rolled back when the invalid one fails.