projects
/
clsql.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r9361: Support for qualified sql identifiers with aliased table names.
[clsql.git]
/
sql
/
classes.lisp
diff --git
a/sql/classes.lisp
b/sql/classes.lisp
index f33a236769d83df592eedf0835d338858bd8d96a..872830f7ebf1bba5e39e66fb5e568a73c77eb35a 100644
(file)
--- a/
sql/classes.lisp
+++ b/
sql/classes.lisp
@@
-160,7
+160,10
@@
(convert-to-db-default-case (symbol-name type) database)))
(format *sql-stream* "~@[~A.~]~A"
(when qualifier
(convert-to-db-default-case (symbol-name type) database)))
(format *sql-stream* "~@[~A.~]~A"
(when qualifier
- (convert-to-db-default-case (sql-escape qualifier) database))
+ (typecase qualifier
+ (string (format nil "~s" qualifier))
+ (t (convert-to-db-default-case (sql-escape qualifier)
+ database))))
(sql-escape (convert-to-db-default-case name database))))
t))
(sql-escape (convert-to-db-default-case name database))))
t))
@@
-579,9
+582,12
@@
uninclusive, and the args from that keyword to the end."
(output-sql (apply #'vector selections) database)
(when from
(write-string " FROM " *sql-stream*)
(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
+ (sql-escape
+ (convert-to-db-default-case from database)) *sql-stream*))
+ (t (output-sql from database))))
(when inner-join
(write-string " INNER JOIN " *sql-stream*)
(output-sql inner-join database))
(when inner-join
(write-string " INNER JOIN " *sql-stream*)
(output-sql inner-join database))
@@
-628,6
+634,7
@@
uninclusive, and the args from that keyword to the end."
t)
(defmethod output-sql ((query sql-object-query) database)
t)
(defmethod output-sql ((query sql-object-query) database)
+ (declare (ignore database))
(with-slots (objects)
query
(when objects
(with-slots (objects)
query
(when objects