overridden to supply a different implementation. The impetus for this
is that I wanted to select from a function's results aliased as the
table instead of the table directly.
prev:
53bf64089da7f091d748f46eb95ebeb39d990dd9
(car objects)
objects))))
(car objects)
objects))))
+(defmethod select-table-sql-expr ((table T))
+ "Turns an object representing a table into the :from part of the sql expression that will be executed "
+ (sql-expression :table (view-table table)))
+
+
(defun find-all (view-classes
&rest args
&key all set-operation distinct from where group-by having
(defun find-all (view-classes
&rest args
&key all set-operation distinct from where group-by having
(flet ((ref-equal (ref1 ref2)
(string= (sql-output ref1 database)
(sql-output ref2 database)))
(flet ((ref-equal (ref1 ref2)
(string= (sql-output ref1 database)
(sql-output ref2 database)))
- (table-sql-expr (table)
- (sql-expression :table (view-table table)))
(tables-equal (table-a table-b)
(when (and table-a table-b)
(string= (string (slot-value table-a 'name))
(tables-equal (table-a table-b)
(when (and table-a table-b)
(string= (string (slot-value table-a 'name))
(sel-tables (collect-table-refs where))
(tables (remove-if #'null
(remove-duplicates
(sel-tables (collect-table-refs where))
(tables (remove-if #'null
(remove-duplicates
- (append (mapcar #'table-sql-expr sclasses)
+ (append (mapcar #'select-table-sql-expr sclasses)
(mapcan #'(lambda (jc-list)
(mapcar
(mapcan #'(lambda (jc-list)
(mapcar
- #'(lambda (jc) (when jc (table-sql-expr jc)))
+ #'(lambda (jc) (when jc (select-table-sql-expr jc)))
jc-list))
immediate-join-classes)
sel-tables)
jc-list))
immediate-join-classes)
sel-tables)