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

How To Eliminate "withSession {implicit session: Session"

I have the following code whenever I need to access the database, which is everywhere: withSession {implicit session : Session => ... } How do I stop having to type so much?
John Tseng
  • 6,262
  • 2
  • 27
  • 35
0
votes
1 answer

DBAction causes play server not responding

I was doing some simple testing with play-slick. I first used DB.withSession {implicit s:Session => ...} in Global.scala, and it works very well. Then I tried to use DBAction{} in my controller, and things start to fall apart. package…
windweller
  • 2,365
  • 5
  • 33
  • 56
0
votes
1 answer

Slick Mtable.getTables select database name

My Scala/Play DB URL config looks like this: db.default.url="jdbc:mysql://localhost" I don't(can't) select the database, because I use multiple databases. I have a method that retrieves data from database table in form of a map of column name and…
Caballero
  • 11,546
  • 22
  • 103
  • 163
0
votes
1 answer

Scala/Slick plain SQL: retrieve multiple results into list of maps

I have a simple method that retrieves single row from a db table: object Data { implicit val getListStringResult = GetResult[List[Object]] ( r => (1 to r.numColumns).map(_ => r.nextObject).toList ) def getUser(id: Int):…
Caballero
  • 11,546
  • 22
  • 103
  • 163
0
votes
1 answer

Is it possible to auto infer result types in Slick?

Let's say that I have this method that runs a fairly basic query using Slick's plain SQL: object Data { case class User(user: String, password: String) implicit val getUserResult = GetResult(r => User(r.<<, r.<<)) def getUser(user:…
Caballero
  • 11,546
  • 22
  • 103
  • 163
0
votes
1 answer

Using Scala Play and Slick, how do I pass non-trivial relationships to the view

I'm looking at building an application using Play. Imagine a typical eCommerce domain model: Customer, Order, Order Line Item, Product. In investigating various options for persistence the recommendation seems to be to avoid ORM layers in Scala…
Dave DeCaprio
  • 2,051
  • 17
  • 31
0
votes
0 answers

Scala Play Framework Slick - type mismatch issue

I'm following this documentation, trying to put together a simple query: package models import scala.slick.session.Database import Database.threadLocalSession import scala.slick.jdbc.{GetResult, StaticQuery => Q} import javax.sql.DataSource import…
Caballero
  • 11,546
  • 22
  • 103
  • 163
-1
votes
2 answers

How does one run a SQL script before starting application with Slick?

Is there a way with Slick that you can run SQL code before the application starts or in the test set up like in Hibernate? See example https://github.com/geowarin/hibernate-examples/tree/master/standalone-data-jpa/src/main/resources
decapo
  • 789
  • 3
  • 8
  • 25
1 2 3
8
9