Questions tagged [slick-3.0]

Slick is a modern database query and access library for Scala by Typesafe.

Slick is a modern database query and access library for Scala. It allows you to work with stored data almost as if you were using Scala collections while at the same time giving you full control over when a database access happens and which data is transferred. You can write your database queries in Scala instead of SQL, thus profiting from the static checking, compile-time safety and compositionality of Scala. Slick features an extensible query compiler which can generate code for different backends.

New in Slick 3.0.0-M1

These are the major new features in this miletone:

  • A new API for composing and executing database actions.
  • Improved configuration of database connections via Typesafe Config, including built-in support for HikariCP.
  • Support for nested Option types and non-primtive Option types in the Lifted Embedding.
  • Properly typed outer join operators based on the improved Option support.

Useful Links

488 questions
5
votes
0 answers

slick 3 insert or update by custom field

According to the API http://slick.typesafe.com/doc/3.0.0/api/#slick.driver.JdbcActionComponent$SimpleInsertActionComposer insertOrUpdate == Insert a single row if its primary key does not exist in the table, otherwise update the existing record. Can…
initmax
  • 395
  • 2
  • 10
5
votes
1 answer

Slick 3.0 delete and returning values

If I want a returning value when inserting a new row, I can do something like val insertQuery = myTable returning myTable.map(_.id) += SomeData(someString) How can I achieve the same effect when deleting? I tried val deleteQuery = myTable filter…
Khanetor
  • 11,595
  • 8
  • 40
  • 76
5
votes
2 answers

What's a good way to combine pagination and non query grouping in Slick 3.0?

For simplification let's say I have three tables: val postTable = TableQuery[Posts] val postTagTable = TableQuery[PostTags] val tagTable = TableQuery[Tags] One post can have multiple tags and postTagTable just contains the relation. Now I could…
thwiegan
  • 2,163
  • 10
  • 18
5
votes
1 answer

Translate nested join and groupby query to Slick 3.0

I'm implementing a todo list. A user can have multiple lists and a list can have multiple users. I want to be able to retrieve all the lists for a user, where each of these lists contain a list of the users for which it's shared (including the…
User
  • 31,811
  • 40
  • 131
  • 232
5
votes
2 answers

value ~ is not a member of slick.lifted.Rep[Option[Int]]

I have a Scala compile error I have been unable to find any information for. I am using slick 3.0 and am getting a compile error of value ~ is not a member of slick.lifted.Rep[Option[Int]] I believe the issue relates to the way I am using an Option…
GoldenFish
  • 217
  • 2
  • 9
5
votes
5 answers

Caused by: java.sql.SQLException: JDBC4 Connection.isValid() method not supported

My play-framework project is running well in my local but when I am trying to deploy it in heroku I am getting following error. 2015-07-05T06:24:10.456657+00:00 app[web.1]: at…
Vinay
  • 1,280
  • 2
  • 13
  • 18
5
votes
1 answer

slick 3.0.0 with HikariCP driver not loaded - IllegalAccessException: AbstractHikariConfig can not access a member with modifiers "private"

I am trying to use tminglei/slick-pg v9.0.0 with slick 3.0.0 and am getting an IllegalAccessException: akka.actor.ActorInitializationException: exception during creation at akka.actor.ActorInitializationException$.apply(Actor.scala:166)…
Yaneeve
  • 4,751
  • 10
  • 49
  • 87
5
votes
1 answer

How to call Stored Procedures and defined functions in MySQL with Slick 3.0

I have defined in my db something like this CREATE FUNCTION fun_totalInvestorsFor(issuer varchar(30)) RETURNS INT NOT DETERMINISTIC BEGIN RETURN (SELECT COUNT(DISTINCT LOYAL3_SHARED_HOLDER_ID) FROM stocks_x_hldr WHERE…
Tomas Duhourq
  • 81
  • 1
  • 6
4
votes
1 answer

Slick 3.3.3 Filter table using `.inSet` on multiple columns

I have a table with a tuple (2 different columns) as my primary key. I am trying to make a function findByPrimaryKeys(pks: Vector[(Long, Long)]) that returns a query for all the rows with a primary key in the set pks. However, it seems there is no…
benthecarman
  • 125
  • 7
4
votes
0 answers

How to filter composite primary key in Slick 3

I'm new to Slick 3. I want to filter composite primary key as follows that query by using Slick. SELECT * FROM test_table WHERE (pk1, pk2) IN (("a1", "a2"), ("b1", "b2")); I know that Slick can filter multiple conditions…
mattsu
  • 85
  • 4
4
votes
1 answer

Slick AsyncExecutor Exception

I have a Play 2.5 + Slick 3.2 application written in Scala 2.11 that uses the play-slick 2.1.1 plugin. Configuration of Play's thread pool is the default. I know it's the Akka dispatcher. Configuration of Slick's thread…
srzhio
  • 186
  • 2
  • 12
4
votes
2 answers

Error while adding slick dependency using sbt

I'm new in scala world (coming from android world), I have created scala project with play-framework, everything works fine now I need to add database and for that I decided to chose slick, but when I'm trying to add dependency like…
Jemo Mgebrishvili
  • 5,187
  • 7
  • 38
  • 63
4
votes
2 answers

How to read an element from a Scala HList?

There is very few readable documentation about HLists, and the answers I can find on SO come from outer space for a humble Scala beginner. I encountered HLists because Slick can auto-generate some to represent database rows. They are…
JulienD
  • 7,102
  • 9
  • 50
  • 84
4
votes
1 answer

Slick 3.1.1 ambiguous implicit values involving filter and implicit CanBeQueryCondition

I have been trying to create a Generic Dao over Slick 3.1.1 and it includes a generic filter that competes with JPA's findByExample, see the following files: GenericDaoImpl.scala Generic level reusable across all Models UserDao.scala Generic plus…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
4
votes
0 answers

Slick 3 map Custom Type to Option

I want to define a custom type X in Slick 3 that should be Mapped to Option[String]. At the moment I'm trying to use MappedColumnType.base[X, Option[String]], but Option[String] does not seem to be a "BaseColumnType". I know, that Option[X] would be…
tobi
  • 329
  • 4
  • 11