Questions tagged [slick-2.0]

Slick is a modern database query and access library for Scala by Typesafe. Use this tag for specific issues with features introduced in 2.0. Otherwise use the generic [tag:slick]

Use this tag if your question describes issues with features introduced in 2.0 (January 2014).

Specific Features for 2.0 that might require this tag above the generic :

  • Code generator for reverse-engineering the database schema and code generation
  • Driver architecture to allow support for non-SQL, non-JDBC databases.
  • Syntax in the Lifted Embedding in Table definitions
  • Table definitions (and their * projections)
  • HList abstraction for records of arbitrary size
  • Soft inserts
  • The new model for pre-compiled queries
  • dynamicSession (replaced threadLocalSession)
  • server-side Option conversions
  • Changes to the API for Scala Collections syntax.
  • direct embedding (improved)
  • Query scheduling
  • The code generator phase
  • Full type information available in query ASTs

Adapted from the release notes

195 questions
0
votes
1 answer

Foreign key relationship in Slick 2.1.0 and Traits

So I have an existing project. I didn't write any of this, and the author's choice of how they implemented Slick confuses me somewhat. Here is an existing table/slick set of classes: case class SourcesRow(id: Long, …
djsumdog
  • 2,560
  • 1
  • 29
  • 55
0
votes
1 answer

How to transform a Slick 2.1.0 MappedProjection so all its Columns are Options

Let's say I have a case class called Blarg consisting of properties with primitive types: case class Blarg( x: String, y: Int ) Blargs are used in various classes, sometimes as Option[Blarg], sometimes as List[Blarg], and those classes are…
Mike Slinn
  • 7,705
  • 5
  • 51
  • 85
0
votes
1 answer

upgrade scala play slick 1.0.0 to 2.0.0

I had a problem, when I upgrade Slick 1.0.0 to 2.0.0: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for…
Pras
  • 67
  • 7
0
votes
1 answer

Slick 2.10 with postgresql

I am new to slick and I need some help with the following error: java.sql.BatchUpdateException: Batch entry 0 insert into "USER_PROFILE" ... Call getNextException to see the cause. The code which causes this error is (the last line of it): def…
Eli Golin
  • 373
  • 1
  • 16
0
votes
0 answers

Sql string interpolation with slick 2.1 with more than 22 parameters

I'm using string interpolation with slick for generating sql request. Slick string interpolation is working fine when I have less than 22 parameters. Example: val s = sql"select * from my_table where my_table.id = $i" But as slick is using tuples…
ulric260
  • 364
  • 4
  • 15
0
votes
1 answer

Slick 3 configuration ProvisionException on connecting to the database

I am new to slick and am using version 3.1.1 along with the playframework 2.4.6 . I am following this guide in the documentation http://slick.typesafe.com/doc/3.1.1/database.html . The error I am getting is ***ProvisionException: Unable to…
user1591668
  • 2,591
  • 5
  • 41
  • 84
0
votes
0 answers

Slick schema/design guidelines

Suppose I have such schema (simplified), using slick 2.1: // Banks case class Bank(id: Int, name: String) class Banks(tag: Tag) extends Table[Bank](tag, "banks") { def id = column[Int]("id", O.PrimaryKey) def name = column[String]("name") …
dmitry
  • 4,989
  • 5
  • 48
  • 72
0
votes
2 answers

Is there a way to avoid using ._1 in scala slick queries?

I have the following query in scala: val query = for { (table1, table2) <- Customer leftJoin Transaction on (_.custID === _.custID) if table1.name === "ABCD" } yield (table1.name, table2.date) When I use query i have to…
user3098466
  • 329
  • 1
  • 11
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…
0
votes
1 answer

Like clause to accept null in slick

val query = for { s <- Status if s.code like "%" } yield (s) The query above wouldn't return records where Status.code would be null like the way it is in SQL. Is there a way to fetch records with null values when just the "%" wildcard is used…
user773366
0
votes
1 answer

Like clause not working with int column in slick

Slick doesn't seem to support like clauses on int columns. The following code where Status.code is of int type doesn't seem to work. Would there be a workaround for this? val query = for { s <- Status if s.code like "1%" } yield (s)
user773366
0
votes
1 answer

Creating a mapped column type for an Abstract class Scala Slick

I'm trying to create a MappedCOlumnType for an abstract case class that I have. sealed abstract class Address(address: String) implicit val addressToString = MappedColumnType.base[Address, String]( addr => addr.address, addr =>…
Chris Stewart
  • 1,641
  • 2
  • 28
  • 60
0
votes
1 answer

Play-Slick generating errors in routes

I was trying to get started with Slick and Play Framework but I keep getting those errors. I have added slick, play-slick and mysql connector to library dependencies and also the following lines to application.conf: slick.dbs.default.driver=…
Haito
  • 2,039
  • 1
  • 24
  • 35
0
votes
1 answer

In Slick 2.x/3.x, where should I place extra Static methods associated with a Table?

In the upgrade guide of Slick 3.0, I found contents like this: In Slick 1.0 it was common practice to place extra static methods associated with a table into that table’s object. You can do the same in 2.0 with a custom TableQuery object:…
Hanfei Sun
  • 45,281
  • 39
  • 129
  • 237
0
votes
1 answer

PlayFramework - Executing query in DBAction

I'm using Play 2.3.8 and Slick 2.1.0 and according to the docs, I should be able to execute queries in my controller actions like this: val customers = TableQuery[Customers] def index = DBAction { implicit request => val result =…
Jordan
  • 1,599
  • 4
  • 26
  • 42