     {:ok, query, state}
   end
 
-  def disconnect(_exception, %{sock: sock}) do
-    :ok = :gen_tcp.close(sock)
+  def disconnect(_exception, %__MODULE__{socket: socket}) do
+    :ok = :gen_tcp.close(socket)
   end
 
   defp connect(host, port) do
-    with {:error, reason} <- :gen_tcp.connect(host, port, @default_sock_opts, @default_timeout),
+    with {:error, reason} <- :gen_tcp.connect(host, port, @default_socket_opts, @default_timeout),
          do: {:error, Error.new("TCP connect", reason)}
   end
 end

  alias __MODULE__.{Error, Utils}

  @default_timeout 5_000
  @default_sock_opts [packet: :raw, mode: :binary, active: false]

  def connect(opts) do
    host = Keyword.fetch!(opts, :host) |> to_char_list()
    port = Keyword.get(opts, :port, 9042)

    with {:ok, sock} <- connect(host, port),
         {:ok, options} <- Utils.request_options(sock),
         :ok <- Utils.startup_connection(sock, options),
         do: {:ok, %{sock: sock}}
  end

  def checkout(state) do

    end
  end

  def handle_execute(_query, payload, _opts, %__MODULE__{socket: socket} = state) do
    with :ok <- :gen_tcp.send(socket, payload),
        {:ok, %Frame{} = frame} <- Utils.recv_frame(socket) do
      {:ok, frame, state}
    else
      {:error, reason} ->
