           where (if (empty? predicates) "" (str "where " (s/join " AND " predicates)))
           sql (str "select " (s/join "," fields) "from " (s/join "," tables) where)
           rs (.executeQuery stmt sql)]
-      (read-rs rs limit)
+      (read-rs rs :limit limit :offset offset)
       )))

(defn table-cols [ds name]
  (with-db-metadata [meta ds]
    (with-open [rs (.getColumns meta nil nil name "%")]
      (read-rs rs ["COLUMN_NAME" "DATA_TYPE" "TYPE_NAME" "COLUMN_SIZE" "DECIMAL_DIGITS" "NULLABLE" "ORDINAL_POSITION"] 200))) )

(defn exec-query [ds {:keys [tables fields predicates offset limit]}]
  (with-open [con (.getConnection (:datasource ds))]

            has-rs (.execute stmt sql)]
        (if (empty? sqls)
          (if has-rs
            (read-rs (.getResultSet stmt))
            (.getUpdateCount stmt)
            )
          (recur (first sqls) (rest sqls)))
