Database Reference
In-Depth Information
Finally, get the database connection information. I have my data in an SQLite database ile
named data/small-sample.sqlite , as shown in the following screenshot. You can
download this from http://www.ericrochester.com/clj-data-analysis/data/
small-sample.sqlite .
How to do it…
Loading the data is not complicated, but we'll make it easier with a wrapper function:
1.
We'll create a function that takes a database connection map and a table name and
returns a dataset created from this table:
(defn load-table-data
"This loads the data from a database table."
[db table-name]
(i/to-dataset
(j/query db (str "SELECT * FROM " table-name ";"))))
 
Search WWH ::




Custom Search