Work with Relational Databases

By virtue of running on the Java Virtual Machine, Clojure works with any database that can be accessed via Java Database Connectivity (JDBC).[105] With it, we can easily access a large number of RDBMS databases, such as MySQL, SQL Server, PostgreSQL, and Oracle. The core library for dealing with relational databases is next.jdbc. When using this library we have to write custom SQL for each type of database we intend to use.

Several libraries are available for working with next.jdbc. One such library that we’ll cover in this chapter is called HugSQL.[106] This library takes the approach of keeping the SQL separate from the Clojure source files.

Another popular library is called Honey SQL.[107] This library represents ...

Get Web Development with Clojure, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.