O'Reilly logo

Lift Application Development Cookbook by Gilberto T. Garcia Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring a connection to a database using Squeryl

The first thing that we need to learn is how to configure Record to create a connection to a database. The database that we will use to build the example and explain how Record works, is PostgreSQL.

Getting ready

Before we can get started, we need to create a new project and carry out basic steps, such as creating a database and a new user.

  1. Start a new blank project.
  2. Edit the build.sbt file to add the lift-squeryl-record and PostgreSQL driver dependencies, as shown in the following code:
    "net.liftweb" %% "lift-squeryl-record" % liftVersion % "compile",
    "org.postgresql" % "postgresql" % "9.2-1003-jdbc4"  % "compile"
  3. Create a new database.
  4. Create a new user.

How to do it...

  1. Add the following lines into ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required