Skip to content
A fork of Play-Slick plugin v0.5.1 patched to compile under Scala 2.11.1 and compatible with Play Framework 2.3.4
Scala
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
documentation
lib
project
samples
src
.gitignore
.travis.yml
README.md
build.sbt
publish.sbt

README.md

About this fork

This is a fork of the Play Framework's Slick Plugin version 0.5.1 which was the last stable version to compile for Slick 1.0.*

Due to the large amount of legacy code we still have running under Slick 1.0, we needed a build of Slick 1.0 for Play Framework 2.3.4 running under Scala 2.11.1

For Portuguese readers, I've written a walkthrough of the issues found for this build at https://zefonseca.com/playslick051-scala211/

Disclaimer

This build is offered without any warranty.

Use at your own risk, under the same license as the original software products from which this was derived.

About

This plugin makes Slick a first-class citizen of Play 2.2.

The play-slick plugins consists of 2 parts:

  • DDL schema generation Plugin that works like the Ebean DDL Plugin. Based on config it generates create schema and drop schema SQL commands and writes them to evolutions.
  • A wrapper DB object that uses the datasources defined in the Play config files. It is there so it is possible to use Slick sessions in the same fashion as you would Anorm JDBC connections.

Build Status

Setup

In the project/Build.scala file add::

In your application, add "com.typesafe.play" %% "play-slick" % "0.5.0.8" to the appDependencies in your project/Build.scala file:

to your play.Project.

Example :

 val appDependencies = Seq(
   //other deps
  "com.typesafe.play" %% "play-slick" % "0.5.0.8" 
 )

Add slick.default="models.*" and:

db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:mem:play"
db.default.user=sa
db.default.password=""

to application.conf and create a model. Creating models are described in the Slick documentation: http://slick.typesafe.com/doc/1.0.1/lifted-embedding.html#tables.

NOTE: the Slick documentation is slightly outdated. The computer-database contains a proposal that better describes the current reality: https://github.com/freekh/play-slick/blob/master/samples/computer-database/app/models/Models.scala#L20.

Versioning

Play 2.2.x is supported by the 0.5.x series. The Play 2.1 was supported in the 0.4.x series.

From Play 2.3 this module will be integrated into Play.

Please read more about usage on the wiki

Copyright

Copyright: Typesafe 2013 License: Apache License 2.0, http://www.apache.org/licenses/LICENSE-2.0.html

You can’t perform that action at this time.