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

Can't find Types Like TimeStamp Date And Point When using Slick-pg

I'm using slick-pg to have access to types like the Point. But after following the example on the github page usage section, I still couldn't get access types like the Point class. Here's what I have CustomPostgresDriver.scala package…
SamAko
  • 3,485
  • 7
  • 41
  • 77
0
votes
2 answers

SLICK: A simple query using union and parameter lists

I'm new to SLICK (2.1) and am lost in creating my first query using union. Because the parameters are provided from external (via a web interface) eventually, I set them as optional. Please see the comment in the code below. How to create an…
jans
  • 1,768
  • 3
  • 17
  • 22
0
votes
2 answers

How do I check database brand/type dynamically in Slick

I use Oracle in production and H2 in my unit tests. Since we use Oracle Spatial I need to represent geometry objects in some way that will be different in Oracle and H2. I don't need to operate on the geometry types in the database (or at least I…
thoredge
  • 12,237
  • 1
  • 40
  • 55
0
votes
1 answer

Getting tuple of objects and list from Slick 2 query

I have this query that should get a list of message with its sender info and their list of recipients (consider groupID and senderID function parameters): (for { groupUsers <- Users.users if targets.groupID === groupID mRecipients <-…
adheus
  • 3,985
  • 2
  • 20
  • 33
0
votes
1 answer

slick how to execute LIKE query

I am playing with PlayScala and Slick. But stocked at how to execute Like query in Slick2. Any Documentation will be more helpful SQL: SELECT * FROM MyTable WHERE columnA LIKE "%s%";
surenyonjan
  • 2,097
  • 3
  • 17
  • 26
0
votes
1 answer

how to add foreign key constraints in Slick2 with Play framework

I want to add foreign key constraint in one of my model of Play2 Framework with Slick 2. Referring to document Slick2-Mapping-Configuration Suppose, I have two models defined in two scala files: Person and Address inside models directory. Using the…
surenyonjan
  • 2,097
  • 3
  • 17
  • 26
0
votes
1 answer

Scala Slick lambdas throwing compiler error

Having an issue mapping an object with nested objects to Slick (2.1.0). The compiler errors are: [error] Subscriber.scala:42: value ~ is not a member of scala.slick.lifted.Column[String] [error] identityId ~ [error] ^ [error]…
crockpotveggies
  • 12,682
  • 12
  • 70
  • 140
0
votes
1 answer

Complex Slick Join Query

I have multiple tables and I need to return them all together with a Slick query. case class A(id: Int, name: String) case class B(id: Int, name: String) case class C(id: Int, name: String) case class AtoC(aId: Int, dId: Int) case class D(id: Int,…
Benny
  • 3,899
  • 8
  • 46
  • 81
0
votes
1 answer

"SELECT DISTINCT ON" or equivalent in Slick (v2.1)

In pure (Postgres-style) SQL, one can do something like the following: select distinct on (author_id) author_id, title from books; This would give me exactly one record from the books table for every author. Is there an equivalent in Scala's Slick…
Chris W.
  • 1,680
  • 16
  • 35
0
votes
2 answers

Get Values from a Slick 2.0 Query in a case class form

I am trying to get an underlying querys case classes from a Scala Slick query, and it seems more difficult to me than it should be. Here is my compiler error: [info] Compiling 18 Scala sources to /home/target/scala-2.11/classes... [error]…
Chris Stewart
  • 1,641
  • 2
  • 28
  • 60
0
votes
1 answer

Slick subquery: No type for symbol s2 found for Ref s2

I have a query in slick which has a subquery, looking like this: (User join Address on (_.id === _.userId)) .map { case (user, address) => ( user.id, address.id, address.street, Detail.filter(_.userId ===…
Caballero
  • 11,546
  • 22
  • 103
  • 163
0
votes
0 answers

Slick Create Table

I use next code for create simple table as in tutorial: import scala.slick.driver.H2Driver.simple._ import scala.slick._ import scala.slick.lifted.{ProvenShape, TableQuery} object MyModels { case class Person(id: Option[Long], name:…
lito
  • 989
  • 8
  • 21
0
votes
1 answer

Scala Slick MySQL - performing advanced SQL stuff

I have 3 tables in my MySQL db: applications, users and application_images. I need to write a query that will generate the next SQL: SELECT * FROM applications JOIN users ON applications.user_id=users.id LEFT JOIN applications_images ON…
Gregra
  • 773
  • 8
  • 22
0
votes
2 answers

Scala Compiler 2.10.4 fails to compile HList model using Slick 2.0, but sometimes it works. Why?

I get following compilation error using HList from Slick2.0. Most of the time I get this error, but sometimes I don't get this error. Also note that I am using Scala IDE 3.0.3 and I do not get any compliation error in Eclipse ( which is strange ). I…
tuxdna
  • 8,257
  • 4
  • 43
  • 61
0
votes
1 answer

Solving O/R Impedence mismatch using Scala + Slick

Let's say I have the following tables in my database: CREATE TABLE dealers( id INT PRIMARY KEY, name VARCHAR(255) ); CREATE TABLE makers( id INT PRIMARY KEY, name VARCHAR(255) ); CREATE TABLE cars( id INT PRIMARY KEY, make INT FOREIGN…
pathikrit
  • 32,469
  • 37
  • 142
  • 221