 (declare build-ssl-options select-compression)
 
 (def ^:dynamic *fetch-size*)
+(def ^:dynamic *async* false)
+
+;;
+;; Macros
+;;
+
+(defmacro async
+  "Prepare a single statement, return prepared statement"
+  [body]
+  `(binding [*async* true]
+     (do ~body)))
+
+(defmacro with-fetch-size
+  "Temporarily alters fetch size."
+  [^Integer n# & body]
+  `(binding [*fetch-size* ~n#]
+     (do ~@body)))
+
+(defmacro prepare
+  "Prepare a single statement, return prepared statement"
+  ([body]
+     `(binding [hayt/*prepared-statement* true
+                hayt/*param-stack*        (atom [])]
+        ~body))
+  ([session body]
+     `(binding [hayt/*prepared-statement* true
+                hayt/*param-stack*        (atom [])]
+        (.prepare ~session ~body))))
+
+;;
+;; Protocols
+;;
 
 (defprotocol DummySession
   (executeAsync [_ query]))

(deftype DummySessionImpl []
  DummySession
  (executeAsync [_ query] (throw (Exception. "Not connected"))))

(defn ^Cluster build-cluster
  "Builds an instance of Cluster you can connect to.

            SSLOptions ProtocolOptions$Compression]
           [com.datastax.driver.auth DseAuthProvider]
           [com.google.common.util.concurrent ListenableFuture Futures FutureCallback]
           [java.net URI]
           [javax.net.ssl TrustManagerFactory KeyManagerFactory SSLContext]
           [java.security KeyStore SecureRandom]
           [com.datastax.driver.core.exceptions DriverException]))
