Book Image

Clojure Web Development Essentials

By : Ryan Baldwin
Book Image

Clojure Web Development Essentials

By: Ryan Baldwin

Overview of this book

Table of Contents (19 chapters)
Clojure Web Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 9. Database Transactions

In the previous chapter, we continued our use of Migratus migration scripts to create the bleeding-edge hipstr catalog (the artists and albums tables). We also created some YeSQL functions that pulled the catalog data from the database, and rendered it to the screen with such beauty and poise that I wouldn't be surprised if we got a job tomorrow at a rather massive Silicon Valley company.

This chapter will continue along the same vein as the previous: more coding, fewer fun ogre boring things. In this chapter we will cover the following topics:

  • Learning what a database transaction is, and why it's important

  • How database transactions look in Clojure, and how they can be applied when using YeSQL

  • Creating a form that accepts an artist name, album name, and release date, and how to store it in the database using a transaction

This chapter will use everything we've learned so far in the book, including validations using Validateur, routes using Compojure, and YeSQL...