13. Database Interaction and the Application Layer
Activity 13.01: Persisting Historic Tennis Results and ELO Calculations
Solution:
- In a new project, begin with the following dependencies:
{:deps {clojure.java-time {:mvn/version "0.3.2"} Â Â Â Â Â Â Â Â hikari-cp {:mvn/version "2.8.0"} Â Â Â Â Â Â Â Â org.apache.derby/derby {:mvn/version "10.14.2.0"} Â Â Â Â Â Â Â Â org.clojure/data.csv {:mvn/version "0.1.4"} Â Â Â Â Â Â Â Â org.clojure/java.jdbc {:mvn/version "0.7.9"} Â Â Â Â Â Â Â Â semantic-csv {:mvn/version "0.2.1-alpha1"}}}
- In our
src
directory, create the following namespaces:packt-clj.tennis.database packt-clj.tennis.elo packt-clj.tennis.ingest packt-clj.tennis.parse packt-clj.tennis.query
- Creating our connection pool in the database namespace...