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
4
votes
1 answer

play slick database configuration issues with postgres driver

I'm trying to set up a simple play 2.5 application with slick and postgres, but can't seem to get past an error. The error I'm getting is [error] p.a.d.s.DefaultSlickApi - Failed to create Slick database config for key…
kag0
  • 5,624
  • 7
  • 34
  • 67
4
votes
1 answer

(Play 2.4.2, Play Slick 1.0.0) How do I apply database Evolutions to a Slick managed database within a test?

I would like to write database integration tests against a Play Slick managed database and apply and unapply Evolutions using the helper methods described in the Play documentation namely, Evolutions.applyEvolutions(database) and…
Leanne
  • 41
  • 1
4
votes
2 answers

SBT configuration failed to load in Typesafe Activator

I'm currently trying to start a play-slick application through the Typesafe Activator, but it fails to load the SBT configuration and I get this error; /play-slick/build.sbt:30: error: reference to fork is ambiguous; it is imported twice in the same…
Jo_
  • 73
  • 8
4
votes
1 answer

How to query Slick with an optional foreign key to return all records with and without relationship?

I have an optional foreign key defined on Event which goes to EventType. I want to query for all events, even those events which have a None (null) event type. This is the foreign key defined on Event. def eventTypeId =…
Phil
  • 46,436
  • 33
  • 110
  • 175
4
votes
0 answers

In Play Framework 2.3, how do I configure and apply evolutions to the in-memory database?

With my Play 2.3.8/Slick 2.1 app, I'm trying to figure out how to set up multiple databases in my application.conf (MySQL and an in-memory database in MySQL mode), with one being automatically used for testing. I think I got close, but it gives me…
sdanzig
  • 4,510
  • 1
  • 23
  • 27
4
votes
2 answers

Slick - MySQL Syntax Error

I'm using the Play Framework (2.3.1) together with Slick (play-slick version 0.8.0-M1) and a MySQL Database (5.5.28). One of my queries results in a MySQLSyntaxErrorException: Preparing statement: select x2."id", x2."course_id", x2."trainee_id",…
user3346601
  • 1,019
  • 1
  • 11
  • 18
4
votes
2 answers

Can't access delete method on Slick query

This is very very very frustrating. I have been trying to pick up Slick for a while, and obstacles just keep coming. The concept of Slick is really awesome, but it is very difficult to learn, and unlike Scala, it doesn't have "beginner",…
windweller
  • 2,365
  • 5
  • 33
  • 56
4
votes
2 answers

Slick: query multiple tables/databases with getting column names

I have methods in my Play app that query database tables with over hundred columns. I can't define case class for each such query, because it would be just ridiculously big and would have to be changed with each alter of the table on the…
Caballero
  • 11,546
  • 22
  • 103
  • 163
4
votes
2 answers

Play slick and Async - is it a race condition?

Reading Play-Slick DBAction code, I thought that this code might contain a race condition: object DBAction{ // snip def apply(r: (RequestWithDbSession) => Result)(implicit app:Application) = { Action { implicit request => AsyncResult…
thesamet
  • 6,382
  • 2
  • 31
  • 42
3
votes
1 answer

scala: Running a play-slick sample results in import error

Absolute Scala beginner here. I installed scala 2.12.1 in macOS X. I am trying to set up the sample computer-database Play-Slick sample from here Once I cd into computer-database, I ran sbt run, and it results into this error: error: not found:…
Luis Bosquez
  • 386
  • 2
  • 11
3
votes
1 answer

Configuring two databases in PlaySlick using injection

I'm trying to configure two databases using PlaySlick as documented here. The problem in the code below is that even though I configured a second database db2 any attempt to use it redirects the action to db1 (tries to find the table in db1 and…
ps0604
  • 1,227
  • 23
  • 133
  • 330
3
votes
2 answers

Mysql play-slick connection timeout error

Possible duplicate: Create a MySQL connection in Playframework with slick I am using play-slick plugin to try connecting with mysql database. But I get connection timeout error every time slick tries to communicate with the Db. My application.conf…
Usman khan
  • 841
  • 1
  • 9
  • 12
3
votes
1 answer

SQLTimeoutException in play-slick

I'm using play-slick with slick 3.0.0 in this way: I got a connection by val conn = db.createSession.conn then got statement: val statement = conn.prepareStatement(querySQL) and return ResultSet: Future{statement.executeQuery()} But I got a…
xring
  • 727
  • 2
  • 8
  • 29
3
votes
1 answer

Compiled Querys in Slick

I need to compile a query in Slick with Play and PostgreSQL val bioMaterialTypes: TableQuery[Tables.BioMaterialType] = Tables.BioMaterialType def getAllBmts() = for{ bmt <- bioMaterialTypes } yield bmt val queryCompiled = Compiled(getAllBmts…
IgnacioPL
  • 67
  • 1
  • 6
3
votes
1 answer

Errors when converting to postgres

Background Play 2.3 Slick 2.1 Play-Slick 0.7 Running in Typesafe Activator I have a pretty basic Play and Slick-based application. Up to now I've been using the in-memory h2 database used by default in most of the examples. In application.conf I…
sam-w
  • 7,478
  • 1
  • 47
  • 77
1
2
3
8 9