     (.setConsistencyLevel statement (cp/resolve-consistency-level cp/*consistency-level*)))
   statement)
 
-(defn- build-statement
+(defn ^:private build-statement-
   "Builds a Prepare or Simple statement out of given params.
 
    Arities:

  ([^String string-query]
     (set-statement-options- (SimpleStatement. string-query))))

(defn ^PreparedStatement prepare
  "Prepares the provided query on C* server for futher execution.

   This assumes that query is valid. Returns the prepared statement corresponding to the query."
  ([^Session session ^String query]
     (.prepare ^Session session query)))

(defn render-query
  "Renders compiled query"
  [query-params]
  (let [renderer (if hayt/*prepared-statement*
                   hayt/->prepared
                   hayt/->raw)]
    (renderer query-params)))

(defn compile-query
  "Compiles query from given `builder` and `query-params`"
  [query-params builder]
  (apply builder (flatten query-params)))

(defn as-prepared
  "Helper method to create prepared query from `query` string with `?` placeholders and values
   to be bound to the query."
  [query & values]
  (vector query values))

(defn- ^Statement statement-for
  [^Session session query prepared?]
  (if prepared?
    (if (coll? query)
      (build-statement (prepare session (first query))
                       (second query))
      (throw (IllegalArgumentException.
              "Query is meant to be executed as prepared, but no values were supplied.")))
    (build-statement query)))

(defn ^ResultSetFuture execute-async
  "Executes a pre-built query and returns a future.

     * max-connections-per-host: maximum number of connections per host.
     * retry-policy: configures the retry policy to use for the new cluster.
     * load-balancing-policy: configures the load balancing policy to use for the new cluster.

     * consistency-level: default consistency level for all queires to be executed against this cluster
     * ssl: ssl options in the form {:keystore-path path :keystore-password password} Also accepts :cipher-suites with a Seq of cipher suite specs.
     * ssl-options: pre-built SSLOptions object (overrides :ssl)
