Slick 2.0 GA - Functional Relational Mapping Made Easy
Slick 2.0 has been released! With a new Activator template this release makes it easy to get started with Functional Relational Mapping (FRM) in Scala.
Relational database access with Slick works in the same way as accessing in-memory Scala collections. For instance to create a SQL query that sorts a table contain coffees by their name, takes the first 3, then filters out those with a price over $9 and then just returns the coffee name, you simply do:
coffees.sortBy(_.name).take(3).filter(_.price > 9.0).map(_.name)
Query construction in FRMs is elegant, simple, and efficient!
Slick's FRM approach has some advantages over the typical Object-Relational Mapping approach:
- Efficiency with Pre-Optimization
FRM is more efficient way to connect; unlike ORM it has the ability to pre-optimize its communication with the database—and with FRM you get this out of the box. The road to making an app faster is much shorter with FRM than ORM.
- No More Tedious Troubleshooting with Type Safety
FRM brings type safety to building database queries. Developers are more productive because the compiler finds errors automatically versus the typical tedious troubleshooting required of finding errors in untyped strings.
- A More Productive, Composable Model for Building Queries
FRM supports a composable model for building queries. It’s a very natural model to compose pieces together to build a query, and then reuse pieces across your code base.
Read more about the Slick 2.0 release in the open source announcement and the official press release. Make sure you sign up for our Slick 2.0 webinar on February 5. Start using Slick 2.0 in minutes with the new Hello Slick Activator template!