         list-of-sql        (map (fn[x]
                                   (if (.startsWith (str x)
                                                    "(quote ") (apply str "'" (rest x)) x)
-                                  ) (butlast (butlast sql-args)))
-        main-params       (last (butlast   sql-args))
+                                  ) (butlast sql-args))
+        main-params       (last   sql-args)
 
         sql-as-a-string   (str command " " (apply str (for [arg (into []
                                                                     (apply list list-of-sql))] (str arg " ") ) ))

        ]
    (cond
      (= (type type-of-last-arg)  (type {}))
      `(remote-sql-parser "realtime " ~@select-args)

      :else
      `(sql-parser  "realtime" ~@select-args)

        ]
    (cond
      (= (type type-of-last-arg)  (type {}))
      `(remote-sql-parser  "realtime" ~@select-args) ; direct SQL is always treated as realtime

      :else
    `(sql-parser  "select" ~@select-args)
