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

Play 2.6 indicates to use a deprecated Slick class

According to Play 2.6 documentation, Play-Slick should be used as follows: import slick.driver.JdbcProfile class Application @Inject() ( protected val dbConfigProvider: DatabaseConfigProvider, cc: ControllerComponents )(implicit ec:…
ps0604
  • 1,227
  • 23
  • 133
  • 330
0
votes
2 answers

Disconnect from Slick JNDI connection in Play for Scala

Slick defines here how to connect to a database using JNDI: val db = Database.forName(jndiName: String) I use the above to connect to a database in Play for Scala, defining the JNDI connection in application.conf: def read (jndi: String, code:…
ps0604
  • 1,227
  • 23
  • 133
  • 330
0
votes
1 answer

Several data source in Play 2 framework with slick

How can I configure and use several data source in Play 2.5.x Framework with Slick? For example, one data source should be MySQL and another PostgreSQL. slick.dbs.default.driver = "utils.db.TetraoPostgresProfile$" slick.dbs.default.db.driver =…
Nasir
  • 515
  • 5
  • 17
0
votes
2 answers

Slick: how to implement find by example i.e. findByExample generically?

I'm exploring the different possibilities on how to implement a generic DAO using the latest Slick 3.1.1 to boost productivity and yes there is need for it because basing the service layer of my Play Web application on TableQuery alone leads to a…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
0
votes
1 answer

PlaySlick Database Connection to PostgreSQL

I just started working with Play Framework in Scala for a school project so I don't know much about the the Framework yet. I'm trying to connect my project to PostgreSql using slick but it is not working. I did exactly the same I have found in the…
Ken4scholars
  • 6,076
  • 2
  • 21
  • 38
0
votes
1 answer

Play 2.5 Dependency Injection for play-slick Database Configuration

I am trying to use play-slick plugin to interact with a mySQL database. Everything works as expected other than a [warn] I get everytime I compile the code. On this line: val dbConfig = DatabaseConfigProvider.get[JdbcProfile](Play.current) The…
summerNight
  • 1,446
  • 3
  • 25
  • 52
0
votes
1 answer

Play-slick postgres evolution for create function

Here's my evolution 1.sql CREATE OR REPLACE FUNCTION update_changetimestamp_column() RETURNS TRIGGER AS $$ BEGIN NEW.changetimestamp = now(); RETURN NEW; END; $$ language 'plpgsql'; But when I apply this evolution, play-slick is giving me this…
Steve Ng
  • 1,189
  • 1
  • 13
  • 35
0
votes
1 answer

execute query if another query result matches some conditions in Slick3.0

I have a table something like final class FooTable(tag: Tag) extends Table[Foo](tag, "foo") { def id = column[Int]("id", O.PrimaryKey) def amount = column[Long]("amount") def createTs = column[Timestamp]("create_ts") def updateTs =…
suish
  • 3,253
  • 1
  • 15
  • 34
0
votes
1 answer

how to insert record in mysql with unique column value using slick api in play framework

I am new to scala-play framework. I am using Play framework 2.5 and play-slick 1.1.1. I am confused in Future return type when using Action to handle request. I am getting this error: found : scala.concurrent.Future[play.api.mvc.Result] required:…
0
votes
1 answer

Play Framework and Slick project architecture

I'm migrating an Application from Grails to Play Framework and i'm currently trying to figure out what's the best way of organizing the project structure. I want to use Slick Codegen alongside with Flyway for Migrations, cause i want to keep a track…
Driver
  • 538
  • 5
  • 12
0
votes
1 answer

Play Slick: select * from table ignores sortBy

I have the following play/slick 3.0 code that reads an entire table. It works well with the exception that the SQL statement doesn't add the order by (even though it applies sortBy. What could be the problem? def readMany = { val db =…
ps0604
  • 1,227
  • 23
  • 133
  • 330
0
votes
2 answers

Easy way to generate 1.sql from model?

As a Slick noob I do not understand why I have to specify my model twice, first in Scala and then in 1.sql to create the tables. That does not look DRY. Is there an easy way to generate 1.sql (and 2..n.sql) from the model during development?
Hans
  • 467
  • 4
  • 12
0
votes
0 answers

Play Slick version 1.0.1, how to generate the SQL from models?

I am looking at this example: https://github.com/playframework/play-slick/tree/master/samples/computer-database https://github.com/playframework/play-slick/blob/master/samples/computer-database/app/dao/CompaniesDAO.scala How can I generate the SQL…
Phil
  • 46,436
  • 33
  • 110
  • 175
0
votes
1 answer

Insert or Update with Play-Slick

Is there any API in Play-Slick where we can do insert or update at same time. We are using Play-Slick 0.8.0. Thanks
αƞjiβ
  • 3,056
  • 14
  • 58
  • 95
0
votes
1 answer

Play Framework trying to access DB with windows username

I have a db.conf which looks like this in the conf folder: db.default.driver=org.postgresql.Driver db.default.url="jdbc:postgresql://62.210.145.112/babybets" db.default.username=postgres db.default.password="my_password" It is included in the…
1 2 3
8 9