   ([ds table limit]
    (db-query-with-resultset ds
                             [(str "SELECT * FROM " table)]
-                            #(read-rs % limit))
+                            #(read-rs % :limit limit))
    )
   ([ds table] (table-data ds table 100)))
 
 (defn tables [ds]
   (with-db-metadata [meta ds]
     (with-open [rs (.getTables meta nil nil "%" (into-array ["TABLE" "VIEW"]))]
-      (-> (read-rs rs ["TABLE_NAME"] 100)
+      (-> (read-rs rs :columns ["TABLE_NAME"])
           (:rows)
           flatten))))
 

(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)))
