             [clojurewerkz.cassaforte.client :as cc])
   (:import com.datastax.driver.core.Session))
 
-(defn ^:private compile-query-
-  "Compiles query from given `builder` and `query-params`"
-  [builder query-params]
-  ;; TODO: mapcat identity here?
-  (apply builder (flatten query-params)))
-
 ;;
 ;; Schema operations
 ;;

                    (if-not-exists))"
  [^Session session & query-params]
  (cc/execute session
              (compile-query- q/create-index-query query-params )))

(defn drop-index
  "Drop an existing secondary index. The argument of the statement
   is the index name.

   Example, drops an index on `users` table, `city` column:

       (drop-index th/session :users_city)"
  [^Session session & query-params]
  (cc/execute session
              (compile-query- q/drop-index-query query-params) ))

(defn create-table
  "Creates a new table. A table is a set of rows (usually

   all data in it."
  [^Session session ks]
  (cc/execute session
              (new-query-api/drop-table ks)))

(defn use-keyspace
  "Takes an existing keyspace name as argument and set it as the per-session current working keyspace.
