Questions tagged [play-slick]

A plugin that makes Slick a first-class citizen of Play 2.x.

This module is about integrating Slick with Play Framework.

From the documentation:

The Play Slick module makes Slick a first-class citizen of Play. It consists of two features:

Integration of Slick into Play's application lifecycle. Support for Play database evolutions. Because Slick creates and manages both a connection pool and a thread pool, integrating Slick with Play boils down to ensure that all resources allocated by Slick are shutted down when a Play application is stopped (or reloaded).

The plugin has its own release cycle and therefore is not integrated into either core Play or Slick.

128 questions
0
votes
2 answers

Play Framework / Dependent Future Composition

I am trying to do several dependent Slick/DB calls and then display the resulting data within a twirl template. def show(slug: String) = Action.async { implicit rs => for { f <- fooDAO.findBySlug(slug) // f is of type Option[foo] …
krausfm
  • 1
  • 1
0
votes
1 answer

Play-Slick generating errors in routes

I was trying to get started with Slick and Play Framework but I keep getting those errors. I have added slick, play-slick and mysql connector to library dependencies and also the following lines to application.conf: slick.dbs.default.driver=…
Haito
  • 2,039
  • 1
  • 24
  • 35
0
votes
1 answer

play-slick 1.0.0: Cannot define column with type of java.sql.Date

I'm currently trying to define a slick schema as follows using play-framework 2.4.0-RC5 together with play-slick 1.0.0-RC3: import java.sql.Date import play.api.Play import play.api.db.slick.{DatabaseConfigProvider, HasDatabaseConfig} import…
Roman
  • 5,651
  • 1
  • 30
  • 41
0
votes
1 answer

Getting tuple of objects and list from Slick 2 query

I have this query that should get a list of message with its sender info and their list of recipients (consider groupID and senderID function parameters): (for { groupUsers <- Users.users if targets.groupID === groupID mRecipients <-…
adheus
  • 3,985
  • 2
  • 20
  • 33
0
votes
1 answer

slick how to execute LIKE query

I am playing with PlayScala and Slick. But stocked at how to execute Like query in Slick2. Any Documentation will be more helpful SQL: SELECT * FROM MyTable WHERE columnA LIKE "%s%";
surenyonjan
  • 2,097
  • 3
  • 17
  • 26
0
votes
1 answer

Implicit DB Session in Controller

Is it bad practice in Play! Framework to define the implicit DB session inside the controller to have less boilerplate? object MyController extends Controller { implicit val session = DB.createSession } I'm not sure about the life cycle of…
Alexej Haak
  • 480
  • 3
  • 10
0
votes
1 answer

how to disable slick codegen from creating dbModels on each compile?

I tried to comment automatic code gen on each compile in Build.scala as below,but then it my code shows error as it is unable to reference any autogen table models from previous compilations. slick <<= slickCodeGenTask // register manual sbt…
0
votes
2 answers

Scala Compiler 2.10.4 fails to compile HList model using Slick 2.0, but sometimes it works. Why?

I get following compilation error using HList from Slick2.0. Most of the time I get this error, but sometimes I don't get this error. Also note that I am using Scala IDE 3.0.3 and I do not get any compliation error in Eclipse ( which is strange ). I…
tuxdna
  • 8,257
  • 4
  • 43
  • 61
0
votes
1 answer

Play-Slick plugin, throws abstraction error in case of DateTime variables, data types

I have been using slick 2 as the dbms for my play app, though using play-slick plugin rather then slick independently, and added the tototoshi plugins as well, dependencies are: "joda-time" % "joda-time" % "2.4" "org.joda" % "joda-convert" %…
mane
  • 1,149
  • 16
  • 41
0
votes
1 answer

How to composite muliple existing actions into one in play

I have a web needs both auth and also access database, there are 2 plugin needed, one is socialsecure and another one is play-sclick. To use socialsecure, I need to use action of SecuredAction, and to use click, I need to use DBAction, then the…
Daniel Wu
  • 5,853
  • 12
  • 42
  • 93
0
votes
2 answers

How to inject play.api.db.slick.Config.driver.simple.Session inside a slick DAO component

I'm using the cake pattern for injecting dependencies between components in a play 2.2.1 application. Application is composed of play controllers and we use a custom ActionBuilder to open our DB session. We currently pass that DB session all the way…
jpmelanson
  • 595
  • 4
  • 10
0
votes
1 answer

Scala, restrict visibility on a package to a single object

I'm beginning with Slick (and Scala) on playframework. My project is structured with .scala files who contains all classes and objects for a domain concept. package models class Folder(val id: Option[Long], var name: String, val…
gervais.b
  • 2,294
  • 2
  • 22
  • 46
0
votes
1 answer

Use MySQL Replication Driver with Slick/Play

I'm using Slick and Play together with the play-slick plugin and I'm having trouble figuring out if I can use the com.mysql.jdbc.ReplicationDriver with them. I want to use the master/slave features of that driver. When using Slick only, it seems to…
0
votes
1 answer

Slick: Autogenerate H2-DDL in Test case

I'm using slick 2.0.0 in my application and in dev/prod, it is working fine. In test mode, I want to autogenerate a H2 database (out of the slick table definitions) and use this for my test cases. I use scalatest 2.0. The database definition…
Heinzi
  • 5,793
  • 4
  • 40
  • 69
0
votes
1 answer

Start generating auto increment column value from default in slick

I having a table column holds auto increment value. I want to start incrementing from specified vlaue. How can i specify this functionality in slick ddl. Code i am using for column of table creation in slick is : def id = column[Long]("id",…
Rajeev
  • 4,762
  • 8
  • 41
  • 63
1 2 3
8
9