r9360: Strings as table identifiers in SELECT.
[clsql.git] / sql / classes.lisp
index e7bc74e2934fd311b7808f083571ad21db8cb077..4e697caf0cfb7a51cfd402682d8d35dba733da1e 100644 (file)
@@ -13,7 +13,7 @@
 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
 ;;;; *************************************************************************
 
-(in-package #:clsql)
+(in-package #:clsql-sys)
 
 (defvar +empty-string+ "''")
 
 (defvar *select-arguments*
   '(:all :database :distinct :flatp :from :group-by :having :order-by
     :order-by-descending :set-operation :where :offset :limit
-    :inner-join :on))
+    :inner-join :on
+    ;; below keywords are not a SQL argument, but these keywords may terminate select
+    :caching :refresh))
 
 (defun query-arg-p (sym)
   (member sym *select-arguments*))
@@ -577,9 +579,10 @@ uninclusive, and the args from that keyword to the end."
     (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))
@@ -626,6 +629,7 @@ uninclusive, and the args from that keyword to the end."
   t)
 
 (defmethod output-sql ((query sql-object-query) database)
+  (declare (ignore database))
   (with-slots (objects)
       query
     (when objects