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

How to load Play Evolutions module within a custom ApplicationLoader?

I'm using Play-Slick and Play-Slick-Evolutions modules with Play 2.4, and I wrote a very simple custom ApplicationLoader like this: class Cards9AppLoader extends ApplicationLoader { def load(context: Context) = new…
2
votes
1 answer

Slick headOption doing nothing

I have a simple MySQL db with a single row in the REG_PERIODS table. When I run this query I get the row back. val getRegPeriodAction = regPeriods.sortBy(_.endDate).result.head.map { regPeriod ⇒ Logger.debug(s"regPeriod = ${regPeriod}") …
Oli
  • 1,112
  • 1
  • 10
  • 25
2
votes
2 answers

In Scala/Slick, how to refactor codes (respond interception) like this?

Here are the codes: def find(loginInfo: LoginInfo): Future[Option[UserProfile]] = { val res = DB.withSession { implicit session => //if loginInfo.providerID == "waylens" userProfileTable.filter(u => u.userName ===…
Hanfei Sun
  • 45,281
  • 39
  • 129
  • 237
2
votes
1 answer

Slick query => duplicated result

I got those models (simplified) : User(id: Int, name: String) Restaurant(id: Int, ownerId: Int, name: String) Employee(userId: Int, restaurantId: Int) when I use this query : for { r <- Restaurants e <- Employees if r.ownerId === userId…
skylve
  • 133
  • 1
  • 5
2
votes
2 answers

Play framework: Slick does not know how to map the given types

I am trying to use slick in the play framework but struggling with even the simplest of examples. Here is my code: case class Account ( id: Int, email: String, password: String, permission: String ) class Accounts(tag: Tag) extends…
2
votes
2 answers

In Scala, when making a slick sortBy, how can I have it do a case-sensitive sort

I found the Scala slick package's "sortBy" method is not case sensitive. Ex: after implementing the following command: q.sortBy(columnMap("name").desc), I got: TestingIsFun, testing foo1, Testing foo, Is this expected behavior? How can I make it…
SexyNerd
  • 1,084
  • 2
  • 12
  • 21
2
votes
0 answers

Join tables in different databases using Slick 2 (with auto generated data model)

I have a Scala/Play application and I need to join tables from 2 different PostgreSQL databases on the same server using Slick 2. The databases are massive so I don't create classes for my tables manually, I use Slick 2 schema code generator, so if…
Caballero
  • 11,546
  • 22
  • 103
  • 163
2
votes
2 answers

How to connect to Oracle 11g database using Slick via Play 2/TypeSafe Activator?

I am new to Scala and the Play 2 framework. I have a working Oracle 11g database and would like a template to use for connecting to the database using Slick from Play 2. Can anyone provide a sample Scala file that just connects to an Oracle 11g…
Jamar
  • 21
  • 1
  • 4
1
vote
1 answer

How to fix the No implementation for play.api.db.DBApi was bound. with play 2.8.13

we are upgrading the tech stack versions of my project due to log4j vulnerability. SBT 1.6.2, Scala 2.13.6, play_scala 2.8.13 I used below dependencies to connect database and I mentioned db configurations in application.conf file.Also using…
newbie
  • 456
  • 1
  • 6
  • 17
1
vote
1 answer

value isEmpty is not a member of slick.lifted.Rep[Option[java.time.LocalDateTime]]

Im using play-slick 3.0.3 I have such column: val someDate = column[Option[LocalDateTime]]("some_date", O.Default(None)) and in code I want to do: table.someDate.isEmpty but Ive got errors that isEmpty does not exists.. for example for Option[Int]…
FrancMo
  • 2,459
  • 2
  • 19
  • 39
1
vote
1 answer

play slick updating enumeration column

I'm having trouble figuring out how to update a column with type enumeration using play-slick. Here's my enum and case class: object TestStatus extends Enumeration { type TestStatus = Value val Status1 = Value("Status1") } case class Test ( …
itadoatL
  • 63
  • 1
  • 5
1
vote
0 answers

Slick unit testing - duplicate statements in logs

I have a suit of tests for slick in playframework environment, but when they are run, the statements are duplicated in logs, and it seems that they are duplicated as many times as number of tests. So if I have only one test I have one e.g. insert…
1
vote
1 answer

Infinite loop of evolutions with Play! framework and play-slick

After updating my web project which uses Slick and the H2 in-memory database to Play 2.6, I get an infinite loop of these messages: Database 'default' needs evolution! [An SQL script need to be run on your database.] Clicking "Apply this script…
Adam Williams
  • 1,712
  • 3
  • 17
  • 30
1
vote
1 answer

Compiled query doesn't recognize 'exists' method

I am facing a lot of trouble while updating my application from play 2.3.x to play 2.4.11. I started by updating play-slick from version 0.8.1 to 1.1.1, which implies updating slick from 2.1.0 to 3.1.0. I have a generic class which aggregates the…
RafaelTSCS
  • 1,234
  • 2
  • 15
  • 36
1
vote
1 answer

How to use SQL IN operator in Slick

How do you perform the following SQL operation in Slick: select * from tablename where label in ('A', 'B'); Haven't been able to find in the documentation or elsewhere.
Geekster
  • 491
  • 1
  • 8
  • 19
1 2 3
8 9