+15 May 2004 Marcus Pearce (m.t.pearce@city.ac.uk)
+ * sql/classes.lisp: SELECT now accepts table identifiers as strings
+ for CommonSQL compliance.
+ * tests/test-fdml.lisp: added test for table identifiers as strings
+ in SELECT.
+
15 May 2004 Marcus Pearce (m.t.pearce@city.ac.uk)
* sql/sql.lisp: PRINT-QUERY now calls QUERY with result-types and
field-names set to nil.
object, to meet CommonSQL spec need to generate a single
query to read values for all objects, up to max-len count.
+COMMIT,ROLLBACK,START-TRANSACTION:
+ When COMMIT or ROLLBACK are called outside of WITH-TRANSACTION, an sql
+ transaction must be explicitly started first with START-TRANSACTION.
+
OPTIMIZATIONS
* Revisit result-type list creation,perhaps caching
(output-sql (apply #'vector selections) database)
(when from
(write-string " FROM " *sql-stream*)
- (if (listp from)
- (output-sql (apply #'vector from) database)
- (output-sql from database)))
+ (typecase from
+ (list (output-sql (apply #'vector from) database))
+ (string (write-string from *sql-stream*))
+ (t (output-sql from database))))
(when inner-join
(write-string " INNER JOIN " *sql-stream*)
(output-sql inner-join database))
(make-instance 'sql-relational-exp
:operator 'in :sub-expressions rest))
-;; (defsql sql-concat (:symbol "||") (&rest rest)
-;; (make-instance 'sql-relational-exp
-;; :operator '\|\| :sub-expressions rest))
-
(defsql sql-concat (:symbol "concat") (&rest rest)
(make-instance 'sql-relational-exp
:operator '\|\| :sub-expressions rest))
("Boris" "Josef" "Konstantin" "Leon" "Leonid" "Mikhail" "Nikita" "Vladamir"
"Yuri"))
+(deftest :fdml/select/25
+ (clsql:select [first-name] :from "employee" :flatp t :distinct t
+ :field-names nil
+ :result-types nil
+ :order-by [first-name])
+ ("Boris" "Josef" "Konstantin" "Leon" "Leonid" "Mikhail" "Nikita" "Vladamir"
+ "Yuri"))
+
;(deftest :fdml/select/11
; (clsql:select [emplid] :from [employee]
; :where [= [emplid] [any [select [companyid] :from [company]]]]