ScalaQuery

A type-safe database API for Scala

Overview

ScalaQuery is an API / DSL (domain specific language) built on top of JDBC for accessing relational databases in Scala. It was designed with the following goals in mind:

A Scala API for database access Compile-time checking and type-safety Composable non-leaky abstractions
The low-level JDBC API is powerful but comes with a lot of verbosity. ScalaQuery was designed from the ground up to reduce the amount of boilerplate required and make use of Scala's features to provide a more natural fit for database access in a Scala environment. It is easy to get runtime errors from making mistakes with SQL syntax or accessing columns with the wrong data type when you embed SQL strings in your application. With ScalaQuery, all database entities have static types and are manipulated with Scala methods so your database code can be checked by the Scala compiler. ScalaQuery is based on relational algebra and query comprehensions which provide an abstraction that can be composed similarly to what you can do with Scala's collection classes, something which is not possible with plain SQL. Unlike traditional ORMs, ScalaQuery never obscures when a database query is performed and it does not rely on mutable state.

ScalaQuery is easy to add to your project, commercial or non-commercial alike. It is being made available under a liberal BSD-style license and has no dependencies other then the Scala library.

The current release is ScalaQuery 0.9.5 for Scala 2.8.1 and 2.9.0-1, with full support for the following database systems: PostgreSQL, MySQL, H2, HSQLDB/HyperSQL, Derby/JavaDB, MS SQL Server, MS Access, SQLite. Accessing other database systems is possible, with a reduced feature set.

News