May 2018
Beginner to intermediate
290 pages
6h 43m
English
Maps are the Swiss Army knives of Clojure programming: any time you need to bundle together some related data items into a unified whole, one of your first thoughts should be, Hey, I’ll use a map. You can see this thinking at work in the clojure.java.jdbc library, which provides an easy-to-use Clojure interface to a wide variety of relational databases. The functions supplied by clojure.java.jdbc need several pieces of configuration information to find your database, which you supply with a map:
| | (require 'clojure.java.jdbc) |
| | |
| | (def db {:dbtype "derby" :dbname "books"}) |
| | |
| | (clojure.java.jdbc/query db ["select * from books"]) |
In the example, the map bound to db contains the database connection information. Don’t worry about ...
Read now
Unlock full access