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
3
votes
3 answers

unresolved dependency: com.typesafe.play#play-slick_2.10;0.6.0.1: not found

I am getting unresolved dependencies errors when trying to use slick or play-slick with Play Framework 2.2.2, sbt 0.13.0 and Scala 2.10.3 on Mac OS X Mavericks. [info] Updating…
3
votes
0 answers

Slick 2.0 - generic enum mapper

I have problem with upgrading from Slick 1.0 to Slick 2.0 in my Play apllication. In my app I have some User defined types example: sealed trait UserStatus case object NewUser extends UserStatus case object ActiveUser extends UserStatus case object…
mgosk
  • 1,874
  • 14
  • 23
3
votes
2 answers

Using flyway with play in test mode: Schema "public" not found

I use (successfully) the flyway-play plugin in dev and prod mode. I also want to use it in test mode. The documentation says, it runs migrations automatically in test mode. I use scala test and my testcases are wrapped in a fake application with val…
Heinzi
  • 5,793
  • 4
  • 40
  • 69
3
votes
2 answers

Scala/Slick plain SQL: retrieve result as a map

I have a simple method to retrieve a user from a db with Sclick plain SQL method: object Data { implicit val getListStringResult = GetResult[List[String]] ( prs => (1 to prs.numColumns).map(_ => prs.nextString).toList ) def…
Caballero
  • 11,546
  • 22
  • 103
  • 163
3
votes
1 answer

Calling Controller DBAction with scheduled Akka Runnable (in Scala / Play 2.2)

I'm attempting to schedule an Akka job when my Play 2.2 application starts. In it's simplest form, this is what my code looks like: import play.api.Application import play.api.Play.current import play.api.GlobalSettings import play.api.Logger import…
Mike Cialowicz
  • 9,892
  • 9
  • 47
  • 76
3
votes
1 answer

How to use play-slick with H2 and MySQL compatibility mode in dev, and MySQL in production?

I’ve started using play-slick and would like to know if the following is possible. In development I want to use H2 in MySQL compatibility mode, and in production use MySQL. However, I think this isn’t working for me in development because play-slick…
Peter Hilton
  • 17,211
  • 6
  • 50
  • 75
2
votes
1 answer

play-json OWrites for a class in trait which is implemented by an object of same name

When slick generates code, it's something like this (sample1/Tables.scala): package sample1 object Tables extends { val profile = ??? } with Tables trait Tables { case class Class1Row(num: Int) } I just want a dump of db objects using…
One.Punch.Leon
  • 602
  • 3
  • 10
2
votes
1 answer

Slick Json Column Support with MySql

I have a Json type column in MySql and I am using Scala with Slick. How can I Provide support for the Json Column via Slick. class SampleTable(tag: Tag) extends Table[(String, ??)](tag, "test") { override def * : ProvenShape[NodeReference] =…
Akash Sethi
  • 2,284
  • 1
  • 20
  • 40
2
votes
2 answers

Assign dynamically injected database name in Play Slick

I have the following Play Slick DAO class. Note that the database configuration is a constant control0001. The DAO has a function readUser that reads a user based on its user id: class UsersDAO @Inject()(@NamedDatabase("control0001") protected…
ps0604
  • 1,227
  • 23
  • 133
  • 330
2
votes
1 answer

Create table from slick table definition

In PlaySlick sample there is file with sample data access object. https://github.com/playframework/play-slick/blob/master/samples/basic/app/dao/CatDAO.scala and table definition: private class CatsTable(tag: Tag) extends Table[Cat](tag, "CAT") { …
oneat
  • 10,778
  • 16
  • 52
  • 70
2
votes
0 answers

Play-slick: How to log evolutions?

I would like to make sure that all my evolution files are properly run (by my CI agent, which seems to have trouble reading more than one), by logging something like "Applying evolution file 3.sql", or even the whole SQL code that is run to apply…
2
votes
2 answers

Cache Slick DBIO Actions

I am trying to speed up "SELECT * FROM WHERE name=?" kind of queries in Play! + Scala app. I am using Play 2.4 + Scala 2.11 + play-slick-1.1.1 package. This package uses Slick-3.1 version. My hypothesis was that slick generates Prepared statements…
Richeek
  • 2,068
  • 2
  • 29
  • 37
2
votes
1 answer

value delete is not a member of slick.lifted.Query[T,T#TableElementType,Seq]

I am currently playing around with Play and play-slick. The following code gives me an error class GenericRepository(protected val dbConfigProvider: DatabaseConfigProvider) extends HasDatabaseConfigProvider[JdbcProfile] { import driver.api._ …
Magnus
  • 390
  • 2
  • 12
2
votes
0 answers

Play-slick postgres: does it automatically create database?

I was using in memory DB and i didn't have any issue in needing to pre-create the database. I have now changed to using postgres as my play-slick database with the below…
Steve Ng
  • 1,189
  • 1
  • 13
  • 35
2
votes
0 answers

Push data to postgres when app starts play 2.4 play-slick 1.0.0 with migration

I there! I'm following Play-Auth-Slick-Seed example that works excellent! and I'm trying to propose the following model mimicking the User model in there (User.scala, DBTableDefinitions.scala, UserDAOImpl.scala, UserDAO.scala) The model: …
1 2
3
8 9