 
        (delete :users
                (where :name \"username\"))"
-  [table & query-params]
-  (execute- (cons table query-params) query/delete-query))
+  [^Session session table & query-params]
+  (execute- session (cons table query-params) q/delete-query))
 
 (defn select
   "Retrieves one or more columns for one or more rows in a table.
    It returns a result set, where every row is a collection of columns returned by the query."
-  [& query-params]
-  (execute- query-params query/select-query))
+  [^Session session & query-params]
+  (execute- session query-params q/select-query))
 
 (defn truncate
   "Truncates a table: permanently and irreversably removes all rows from the table,
    not removing the table itself."
-  [table]
-  (execute- [table] query/truncate-query))
+  [^Session session table]
+  (execute- session [table] q/truncate-query))
 
 (defn create-user
-  [& query-params]
-  (execute- query-params query/create-user-query))
+  [^Session session & query-params]
+  (execute- session query-params q/create-user-query))
 
 (defn alter-user
-  [& query-params]
-  (execute- query-params query/alter-user-query))
+  [^Session session & query-params]
+  (execute- session query-params q/alter-user-query))
 
 (defn drop-user
-  [& query-params]
-  (execute- query-params query/drop-user-query))
+  [^Session session & query-params]
+  (execute- session query-params q/drop-user-query))
 
 (defn grant
-  [& query-params]
-  (execute- query-params query/grant-query))
+  [^Session session & query-params]
+  (execute- session query-params q/grant-query))
 
 (defn revoke
-  [& query-params]
-  (execute- query-params query/revoke-query))
+  [^Session session & query-params]
+  (execute- session query-params q/revoke-query))
 
 (defn list-users
-  [& query-params]
-  (execute- query-params query/list-users-query))
+  [^Session session & query-params]
+  (execute- session query-params q/list-users-query))
 
 (defn list-permissions
-  [& query-params]
-  (execute- query-params query/list-perm-query))
+  [^Session session & query-params]
+  (execute- session query-params q/list-perm-query))
 
 ;;
 ;; Higher level DB functions

  "Executes query to get exactly one result. Does not add `limit` clause to the query, this is
   a convenience function only. Please use `limit` clause if you execute queries that potentially
   return more than a single result."
  [& query-params]
  (first (execute- query-params query/select-query)))

(defn perform-count
  "Helper function to perform count on a table with given query. Count queries are slow in Cassandra,
   in order to get a rough idea of how many items you have in certain table, use `nodetool cfstats`,
   for more complex cases, you can wither do a full table scan or perform a count with this function,
   please note that it does not have any performance guarantees and is potentially expensive."
  [table & query-params]
  (:count
   (first
    (select table
            (cons
             (query/columns (query/count*))
             query-params)))))

;;


(defn- get-chunk
  "Returns next chunk for the lazy world iteration"
  [^Session session table partition-key chunk-size last-pk]
  (if (nil? (first last-pk))
    (select session table
            (q/limit chunk-size))
    (select session table
            (q/where (apply q/token partition-key) [> (apply q/token last-pk)])
            (q/limit chunk-size))))

(defn iterate-world
  "Lazily iterates through the collection, returning chunks of chunk-size."
  ([^Session session table partition-key chunk-size]
     (iterate-world session table (if (sequential? partition-key)
                            partition-key
                            [partition-key])
                    chunk-size []))
  ([^Session session table partition-key chunk-size c]
     (lazy-cat c
               (let [last-pk    (map #(get (last c) %) partition-key)
                     next-chunk (get-chunk table partition-key chunk-size last-pk)]
                 (iterate-world session table partition-key chunk-size next-chunk)))))
