(clsql-sys:file-enable-sql-reader-syntax)
+(defmacro has-sql-value-conversion-error (() &body body)
+ `(let (*debugger-hook*)
+ (handler-case
+ (progn ,@body nil)
+ (clsql-sys::sql-value-conversion-error (c)
+ (declare (ignore c))
+ t))))
(setq *rt-oodml*
'(
+(deftest :oodml/read-symbol-value/1-into-this-package
+ (clsql-sys::read-sql-value
+ (clsql-sys::database-output-sql-as-type 'symbol 'clsql-tests::foo nil nil)
+ 'symbol nil nil)
+ clsql-tests::foo)
+
+(deftest :oodml/read-symbol-value/2-into-another-pacakge
+ (clsql-sys::read-sql-value
+ (clsql-sys::database-output-sql-as-type 'symbol 'clsql-sys::foo nil nil)
+ 'symbol nil nil)
+ clsql-sys::foo)
+
+(deftest :oodml/read-symbol-value/3-keyword
+ (clsql-sys::read-sql-value
+ (clsql-sys::database-output-sql-as-type 'keyword ':foo nil nil)
+ 'keyword nil nil)
+ :foo)
+
+(deftest :oodml/read-symbol-value/4-keyword-error
+ (has-sql-value-conversion-error ()
+ (clsql-sys::read-sql-value
+ (clsql-sys::database-output-sql-as-type 'keyword 'foo nil nil)
+ 'keyword nil nil))
+ T)
+
+(deftest :oodml/read-symbol-value/5-unknown-type-error-1
+ (has-sql-value-conversion-error ()
+ (clsql-sys::read-sql-value
+ (clsql-sys::database-output-sql-as-type 'bloop 'foo nil nil)
+ 'bloop nil nil))
+ t)
+
+(deftest :oodml/read-symbol-value/6-unknown-type-error-2
+ (has-sql-value-conversion-error ()
+ (clsql-sys::read-sql-value
+ (clsql-sys::database-output-sql-as-type 'bloop 'foo nil nil)
+ '(or integer float) nil nil))
+ t)
+
+(deftest :oodml/read-symbol-value/read-list
+ (clsql-sys::read-sql-value
+ (clsql-sys::database-output-sql-as-type
+ 'list '(("status" "new" "open")) nil nil)
+ 'list nil nil)
+ (("status" "new" "open")))
+
(deftest :oodml/select/1
(with-dataset *ds-employees*
(mapcar #'(lambda (e) (slot-value e 'last-name))
(select 'deferred-employee-address :flatp t :order-by [aaddressid] :caching nil)))
(10 10 nil nil nil nil))
+(deftest :oodm/retrieval/10-slot-columns
+ (with-dataset *ds-employees*
+ (mapcar #'title
+ (select 'employee :flatp t :caching nil
+ :where [<= [emplid] 3]
+ :order-by `((,[emplid] :asc)))))
+ (supplicant :adherent cl-user::novice))
+
;; tests update-records-from-instance
(deftest :oodml/update-records/1
(with-dataset *ds-employees*