ActiveSlick is a library that offers CRUD operations for Slick 2.1 projects. The main goal is to provide some basic operations to manage the lifecycle of persisted objects (new/persisted/deleted/stale) and enable the implementation of the Active Record Pattern on Slick mapped case classes.
All operations are provided by TableQueries sub-classes.
- Basic CRUD and auxiliary methods - add/update/save, delete, list, pagedList, (paged result), findById and count.
- Model classes don't need to implement any specific class or trait,
although for convenience you can extend
IdentifiableorVersionabletraits. - Generic Id type.
Identifiabletrait and respectiveEntityTableto manage Entities.Versionabletrait and respectiveVersionableEntityTablefor optimistic locking.ActiveRecordtrait to enable the Active Record Pattern on mapped case classe via class extensions (pimp-my-library style)
The latest release (0.2.2) is available on Sonatype's repository. This is a crossbuild for Scala 2.10 and 2.11 and and Slick 2.1.
libraryDependencies += "io.strongtyped" % "active-slick_2.10" % "0.2.2"
or
libraryDependencies += "io.strongtyped" % "active-slick_2.11" % "0.2.2"
or
libraryDependencies += "io.strongtyped" %% "active-slick" % "0.2.2"
Usage information can be found on the wiki pages or via an Activator Template.