We are happy to announce the release of Slick 3.1.0. These are the major new features compared to Slick 3.0.0:
((xs joinLeft ys on (_.b === _.b)) joinLeft ys on (_._1.b === _.b)).to[Set]
used to get compiled to deeply nested code which could prevent proper optimization by some database engines (in particular MySQL) with Slick 3.0:
select x2.x3, x2.x4, x2.x5, x2.x6, x2.x7, x2.x8, x2.x9, x2.x10
from (
select x11.x12 as x3, x11.x13 as x4, x11.x14 as x5, x11.x15 as x6, x11.x16 as x7, x17.x18 as x8, x17.x19 as x9, x17.x20 as x10
from (
select x21.x22 as x12, x21.x23 as x13, x24.x25 as x14, x24.x26 as x15, x24.x27 as x16
from (
select x28."a" as x22, x28."b" as x23
from "xs_jo" x28
) x21
left outer join (
select 1 as x25, x29."a" as x26, x29."b" as x27
from "ys_jo" x29
) x24
on x21.x23 = x24.x27
) x11
left outer join (
select 1 as x18, x30."a" as x19, x30."b" as x20
from "ys_jo" x30
) x17
on x11.x13 = x17.x20
) x2
Slick 3.1 produces the following code instead:
select x2."b", x3."b", x3."a", x4."b", x2."a", x4."a"
from "xs_jo" x2
left outer join "ys_jo" x3
on x2."b" = x3."b"
left outer join "ys_jo" x4
on x2."b" = x4."b"
db {
connectionPool = disabled
dataSourceClass = "slick.jdbc.DriverDataSource"
properties = {
driver = "org.h2.Driver"
url = "jdbc:h2:mem:test_ds1"
properties = {
LOCK_MODE = 1
}
}
}
db {
dataSourceClass = "slick.jdbc.DatabaseUrlDataSource"
properties = {
driver = "org.postgresql.Driver"
url = "postgres://user:pass@host/dbname"
}
}
You can find the source code for the new release here. Builds for Scala 2.10 and 2.11 are available from Maven Central, as usual. The commercial [Slick Extensions] package with closed-source drivers for Oracle, DB/2 and SQL Server has been published to the Typesafe repository. See the manual for details on adding it to your build.
In order to use Slick in a Play application we provide the Play Slick plugin. Version 1.1.0, which integrates Slick 3.1.0 into Play 2.4, is now available.
If you are new to Slick check out the Hello Slick template in Typesafe Activator to get started. You can see how Slick is used in a Play application in the Play Scala Intro template.