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
25
votes
2 answers

Returning AutoInc ID after Insert in Slick 2.0

I have looked to the ends of the earth for the answer to this question. There is not much info out there on slick 2.0. Below is my code for my Addresses model, how would I have the method create return the id after it made the insert? package…
James Little
  • 601
  • 7
  • 24
23
votes
2 answers

How to run ScalaTest with Guice DI and Slick?

I don't know how to configure GuiceApplicationBuilder in such a way, that I am able to load controllers that require a DatabaseConfigProvider to be injected. I'd like to specify an alternative postgres database for testing, or an in memory database…
Taig
  • 6,718
  • 4
  • 44
  • 65
12
votes
1 answer

Configuring a Postgresql connection with Play 2 and Slick-Play

I'm learning how to build an application using Scala and the Play 2 Framemork. I`ve created a new project using the activator tool, based on "play-scala-intro" current template. The template have a sample app using the Play-Slick 1.0 for managing…
damorais
  • 135
  • 1
  • 8
12
votes
1 answer

Scala, Play Framework Slick issue - could not find implicit value for parameter rconv

I'm following guidelines of Slick documentation and I don't understand what I'm doing wrong here: package models import scala.slick.session.Database import Database.threadLocalSession import scala.slick.jdbc.{GetResult, StaticQuery => Q} import…
Caballero
  • 11,546
  • 22
  • 103
  • 163
11
votes
2 answers

How to apply play-evolutions when running tests in play-framework?

I have problems with evolutions when running tests in play framework using playframework v2.6.6 for scala play-slick v3.0.2 play-slick-evolutions v3.0.2 The test looks like this: class TestFooController extends PlaySpec with GuiceOneServerPerSuite…
11
votes
4 answers

Play/Slick: SQLTimeoutException: Timeout after 1001ms of waiting for a connection

I've created an empty (activator template play-scala) Play 2.4.3 application with PostgreSQL 9.4 database and trying to use Slick 3.1.0 with it, but it's throwing an error: play.api.UnexpectedException: Unexpected exception[SQLTimeoutException:…
Caballero
  • 11,546
  • 22
  • 103
  • 163
11
votes
2 answers

Run Evolutions in Command Line

It's my first day tinkering with the Play framework, and I'm having a hard time with evolutions. I'm using Play 2.4. I picked a sample app from the many that come up in activator ui, it uses play-slick and play-slick-evolutions for DB connection and…
charmeleon
  • 2,693
  • 1
  • 20
  • 35
10
votes
2 answers

Injecting PlaySlick database connection in ScalaTest

I have the following DAO that connects to a database using PlaySlick. The class has a method read that I need to test with ScalaTest. My problem is that I don't know how to mock DatabaseConfigProvider to inject it in the UsersDAO class and test the…
ps0604
  • 1,227
  • 23
  • 133
  • 330
10
votes
2 answers

Play 2.4 - Slick 3.0.0 - DELETE not working

I am trying to upgrade to Slick 3.0.0 and Play 2.4 (Scala), but deleting rows is not working. In the code below, everything works: querying all rows, inserting and updating - except delete. package dao import scala.concurrent.Future import…
Carlos Souza
  • 351
  • 6
  • 13
8
votes
1 answer

Play-slick with SecureSocial: Running DB IO in a separate thread pool

I have a Play 2.2.1 app that uses play-slick 0.5.0.8 to persist data to a Postgresql backend and SecureSocial 2.1.2 to handle user authorisation. Since play-slick transactions are blocking, I have created a separate slick-context execution context…
dbau
  • 16,009
  • 2
  • 21
  • 31
7
votes
2 answers

Play tests with database: "Too many connections"

To have a database available in scalatest with evolutions I use this extension of the default PlaySpec inspired by this SO question: trait ResetDbSpec extends PlaySpec with BeforeAndAfterAll { lazy val appBuilder = new GuiceApplicationBuilder() …
JulienD
  • 7,102
  • 9
  • 50
  • 84
6
votes
1 answer

How to use a Non Supported Database in Slick 3.1

In the past I have used Slick to access a Vertica database in a server. I recently upgraded my version of Slick from 2.0 to 3.1. Since the upgrade, I am encountering an error (stack trace below). The error indicates that the slick driver cannot be…
JMess
  • 623
  • 9
  • 11
6
votes
4 answers

Slick 3.0.0 - How to sortBy on a query with joinLeft

This question is related to another. I'm also trying to sort on a query with a joinLeft but in slick 3.0.0. And as the Option Rep are automatically lifted how would I do the exact same thing ?: def list(filter: String, orderBy:…
Camille Wanty
  • 76
  • 1
  • 5
6
votes
4 answers

Slick: create query conjunctions/disjunctions dynamically

I'm trying to create a typesafe dynamic DSL for a Slick table but not sure how to achieve this. Users can post filters to the server by sending filters in form/json format, and I need to build a Slick query with all that. So basically this means…
Sebastien Lorber
  • 89,644
  • 67
  • 288
  • 419
6
votes
1 answer

How to create projection class for complex case class in slick?

For example I have this case class: case class User( var identityId: IdentityId, //Its a user created class var firstName: String, var lastName: String, var fullName: String, var email: Option[String], var avatarUrl: Option[String], …
mane
  • 1,149
  • 16
  • 41
1
2 3
8 9