reddmetrics/cartodb-clj — pull request #6 by eightysteele (2012-06-14 04:06:54+00:00)
Title: Add :host :api-key :format options to query with tests.

This pull request adds some additional parameters to the `query` function (e.g., :host, :api-key, :format). Here's a request for CSV:

```clojure
(fact "Check CSV format."
(let [sql "SELECT x,y,the_geom FROM forma_cdm LIMIT 1"]
(query "wri-01" sql :format "csv") => "x,y,the_geom\r\n49826,31489,"))
```

Note that `query` no longer returns just the `:rows` from a JSON response. Instead it returns the entire JSON response body. For example:

```clojure
(fact "Check JSON format."
(let [sql "SELECT x,y,the_geom FROM forma_cdm LIMIT 1"]
(:rows (query "wri-01" sql :format "json")) =>
[{:x "49826", :y "31489", :the_geom nil}]))
```