We have just released Slick 2.0.0-M3, the third milestone for Slick 2.0. It should show up on Maven Central within the next few hours. You can find the source code here: https://github.com/slick/slick/tree/2.0.0-M3. Please see http://slick.typesafe.com/docs/ for documentation.
We published M2 in July but it was never officially announced and did not come with updated documentation, so these release notes include the changes for both, M2 and M3.
These are the major new features added since M1:
Table definitions in the Lifted Embedding use a new syntax which is slightly more verbose but also more robust and logical, avoiding several pitfalls from earlier versions.
Table definitions (and their
*projections) are not restricted to flat tuples of columns anymore. They can use any type that would be valid as the return type of a Query. The old projection concatenation methods
~:are still supported but not imported by default.
In addition to Scala tuples, Slick supports its own
HListabstraction for records of arbitrary size. You can also add support for your own record types with only a few lines of code. All record types can be used everywhere (including table definitions and mapped projections) and they can be mixed and nested arbitrarily.
Some changes to the API to bring it closer to Scala Collections syntax.
threadLocalSessionhas been renamed to
dynamicSessionand the corresponding methods have distinct names (e.g.
withDynSessionvs the standard
withSession). This allows the use of the standard methods without extra type annotations. Thread-local sessions are not deprecated but we want to push explicit session management (with the now simpler syntax) as the default.
Some important parts of the query compiler have been rewritten. Column flattening and the emulation of
Booleanwhich is required by some databases should now be more robust.
Soft inserts are now the default, i.e.
AutoInccolumns are automatically skipped when inserting with
insertAll. This means that you no longer need separate projections (without the primary key) for inserts. There are separate methods
JdbcProfilefor the old behavior.
A new model for pre-compiled queries replaces the old
QueryTemplateabstraction. Any query (both, actual collection-valued
Queryobjects and scalar queries) or function from
Columntypes to such a query can now be lifted into a
Compiledwrapper. Lifted functions can be applied (without having to recompile the query), and you can use both monadic composition of
Compiledvalues or just get the underlying query and use that for further composition.
Note that this is not a production-ready or beta release. The Slick Extensions package is not available for this milestone release and the Slick Examples and Slick Testkit Example projects have not been updated yet.
We expect that the next published version of Slick will be 2.0.0-RC1 which will integrate code-generator-based type providers and add more documentation and bug fixes. It will also come with an updated Slick Extensions package.
Here is a complete list of changes since M1:
b70a2c7Update build for 2.0.0-M3
1c488eaDeprecate notIn, add filterNot for orthogonality and conformity with Scala collections see https://github.com/slick/slick/pull/204
d1849b8Add a separate compiler phase for boolean emulation.
32e8ceebumped scala to 2.10.3, sbt to 0.13.0, mima to 0.1.6
24b0ed7Fix existing doctests, execute all doctests (including required fixes)
2a4d156Fix fusion of Take and Drop operators.
3464b5eFix compilation error introduced by merging #232 and #243 together.
48f0648Add test case for multi-level mapping with <>, prompted by issue #78.
c2eb8daAdd createDDLInvoker (similar to createInsertInvoker).
c897ad9Add HList and Nat implementations with Shapes for the HList.
d6428b7Simplify custom Shape definitions
99f19fcUse bind variables for types which do not support literals.
68996f0Skip AutoInc columns by default when inserting data.
bda93a7Introduce “Compiled” computations to replace parameterized queries.
4ee1c5cTreat Unit as an empty product type.
bbf9694Add a common abstraction for literal and parameter columns.
b8eaa59Improve Shape encoding to support Columns-level Shapes.
942d98fAdd a nested Shape for Queries.
f16915dAllow unit tests which assure that some code does not type-check.
ff992bbAdd Shape levels to differentiate between flat and nested Shapes.
e9d6f69Running a query to match a specific UUID in MySQL fails in 1.0.1. For example, the following code will fail with error “UUID does not support a literal representation”.
1c1bf30Fuse simple mappings before resolving GroupBy.
009dc35Flatten nested ProductNodes in GroupBy keys.
01410cdUse fixed version numbers for fmpp’s dependencies.
d054bf5Rename .elements to .iterator.
64b1a12Allow identity (primary key auto-increment) types to be overridden.
2721a90Quote the table name correctly in InsertBuilder.
1be8a52Add hashCode() implementation to ProductValue.
5be75d3Add regression test for grouping by 3 columns.
05ded5cAdd documentation about using connection pools.
57d886fUpdate documentation for new table definitions and tuple syntax.
b28d2a1Fix build for building against Scala 2.11
74ecd59Don’t mark types as observed in dumps and when building typed copies.
56cdd2dFix MatchError in tree dumps.
81e50a7Fix code style, transaction example, line wrap, search button layout, typos
8829bf9updates docs to not show dynamicSession as default
621947aadjusted docs to match changes regarding dynamicSession in 83d470796c2836d1a66d5b00726bc152bec63ac6
98eee6dfixes compilation errors in dockets:test (which somehow creeped in)
5bb13ebadjusted docs for OSX
c3b771aAdd Google Analytics token to the generated docs fixes assembla ticket #188
d755e69added connection / transaction docs
a67ca6cchanged to docs Slick theme
e75919eprepare for theme change (code lines < 100 chars)
fa3c659Add some scaladoc comments to the lifted embedding.
353a260Update the Typesafe Project & Developer Guidelines.
27fc9caRemove some cruft from the AST.
5bc8d29Implement the new column expansion and flattening scheme.
7b114bfFind all referenced table columns in inferTypes.
29fc842Create a TableExpansion when creating a TableNode.
697dc78Simplify tagging and ref encoding.
e33ba26Simplify the Shape API + implementation and MapperTest
e0c8db6Support for easy type mapping in Shapes.
9e566e2Remove Node.apply and rename NodeGenerator.nodeDelegate to .toNode.
379b649Move the conversion of values to Nodes into Shape.
78bad9eMove encodeRef functionality for container types into Shape.
5e98612Simplify the creation of packed Shape of QueryParameters.
531607dfixes doctest:test compilation errors introduced by 83d470796c2836d1a66d5b00726bc152bec63ac6
db9116dSlick 2.0.0-M2 release
36f95d7Use the ++ operator for unionAll.
5978155Allow the use of += and ++= for more complex inserts in JdbcProfile.
b16cbc5Improve threadLocalSession API
6cd987eMake tuple extension methods optional.
820670bSprinkle some macro sugar on TableQuery.
6a3467eIntroduce the new table model.
5506063Add query-based DDL and Insert APIs.
cf1b244Complete separation of Nodes and Reps.
2f6e031Disentangle lifted embedding tables from TableNodes.
8239fb7Simplify typing of Nodes.
64e1f6bSome minor cleanup work
a63846dRemove “by” Symbol from GroupBy.
count(*)semantics workaround in QueryInterpreter.
83c487dImprove handling of types in the AST and query compiler.