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
1
vote
0 answers

java.lang.ClassNotFoundException: play.core.server.NettyServer

I am trying to add play-slick to my project, when I refresh my sbt I get no errors but in compile time it breaks with this error: java.lang.ClassNotFoundException: play.core.server.NettyServer. I've tried multiple fixes found on the internet but…
Punny
  • 46
  • 6
1
vote
1 answer

explicitly close db connection in slick

Here is code I am trying to optimise: object UserRepo { val users = TableQuery[Users] val dbName = "db" lazy val queryAllUsers = for (user <- users) yield user type UserRow = (Int, String, String, String) def getAll() : Future[…
Pavel
  • 1,519
  • 21
  • 29
1
vote
1 answer

Use multiple DB / Schema in a single DBIO in Slick

Let's say If I have 2 Schema below.Both of them are in a same MySQL server. master base The problem is I can't use more than 2 schema actions in a single Database run. If I execute such plain sql queries via sql, It works without any problem. def…
suish
  • 3,253
  • 1
  • 15
  • 34
1
vote
1 answer

Play Slick Global Lookup setup deprecated message

As stated in Play Slick documentation a DatabaseConfig object can be obtained via Global Lookup: val dbConfig = DatabaseConfigProvider.get[JdbcProfile](Play.current) However I get the following compilation warning stating that current is deprecated…
ps0604
  • 1,227
  • 23
  • 133
  • 330
1
vote
2 answers

Slick 3.1.x Generic DAO for JdbcProfile error "value id is not a member of ..."

I'm trying to create a Slick 3.1.1 Generic DAO for my slick code-generated model. However, I'm facing one last compilation error that can't find how to fix. The whole project is available in GitHub play-authenticate-usage-scala and the relevant…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
1
vote
1 answer

What's the purpose of doing: x.map { _ => () }

I have been looking at some of the Play Slick examples for building the data access layer and found the following line in the CatDAO example a bit intriguing: def insert(cat: Cat): Future[Unit] = db.run(Cats += cat).map { _ => () } and I wonder…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
1
vote
1 answer

Timeout when making an evolution with Slick 3.1 and PlayFramework 2.5 Scala

I'm currently developing a WebApp in order to improve my skills in Play Framework with Scala. I have followed this tutorial : http://pedrorijo.com/blog/play-slick/ I've adapted the code to my user object (changing field), but globally this is the…
Argurth
  • 625
  • 6
  • 18
1
vote
2 answers

How to insert a record having foregin key using slick 3?

I have two models: case class User(uid: Option[Int], email: String, password: String, created_at: Timestamp, updated_at: Timestamp) case class UserProfile(firstname: String, lastname: String, gender: Int, user_id: Long), And a DAO with user table…
Maverick
  • 2,738
  • 24
  • 91
  • 157
1
vote
1 answer

How can I check if Play Slick filter has returned some rows or an empty result?

I have the below code which returns Future[Option[Password]] db.run(passwords.filter { x => x.providerID === loginInfo.providerID && x.providerKey === loginInfo.providerKey }.result.headOption) What I want to do is as in the below pseudo…
Priya R
  • 451
  • 4
  • 14
1
vote
2 answers

Multiple inserts in same transaction with Slick 3.0

I'm in the middle of upgrading my Play Framework application using slick 2.1.0 to play-slick 1.0.0 (which includes slick 3.0.0). I'm having some problems understanding how transactions are handled. Lets say I have the following piece of…
ulejon
  • 631
  • 5
  • 22
1
vote
1 answer

play-slick : not found table

I want to use play-slick 1.0.0 with play 2.4.0. According to the sample (https://github.com/playframework/play-slick/tree/master/samples/basic), I defined the UserTable like this: package tables import models.User import…
garasubo
  • 85
  • 7
1
vote
1 answer

Slick 3 - ForeignKeys are not generated

I cannot seem to find a solution to this weird bug: class Names(tag: Tag) extends Table[Name](tag, "NAME") with Identifiable[Name]{ def firstName = column[String]("firstName") def lastName = column[String]("lastName") def profileId =…
Tim Joseph
  • 847
  • 2
  • 14
  • 28
1
vote
0 answers

Why does the compiler report error for custom generic DAO?

I'm trying to make a generic DAO class to use in all my DAO objects. I have the following auto-generated Slick models (in a file dbTables.Tables): case class UserusergroupsRow(userusergroupid: Int, usergroupid: Int, userid: Int, status: String,…
1
vote
1 answer

How to apply new changes without dropping current data in the db.(Playframework evaluations)

I'm using play 2.2.1 with scala. And I have a managing database evaluations. When I run my application with changes on the database, it'll drop all my datas. At this moment evaluationplugin = disabled is comment in. If I comment out, it does not…
Bob
  • 1,351
  • 11
  • 28
1
vote
2 answers

Where to put my database access methods when using a DAO with Slick 2.0?

(This question is based on a very similar previous request for help. With the introduction of a DAO and multiple database drivers, the same problem requires a different approach, and I hope warrants a new SO question.) I have a class and Slick Table…
sam-w
  • 7,478
  • 1
  • 47
  • 77
1 2 3
8 9