Slick 2.0.0

January 21 2014
by Stefan Zeiger

We are happy to announce the release of Slick 2.0.0. The artifacts are available on Maven Central, as usual. You can find the source code here: https://github.com/slick/slick/tree/2.0.0. Please see http://slick.typesafe.com/docs/ for documentation. This release breaks source compatibility with Slick 1.0 in some areas, hence the 2.0 version number. You can find more information about these changes in the migration guide.

These are the major new features added since Slick 1.0.1:
  • A code generator that reverse-engineers the database schema and generates all code required for working with Slick.

  • New driver architecture to allow support for non-SQL, non-JDBC databases.

  • 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 ~ and ~: are still supported but not imported by default.

  • In addition to Scala tuples, Slick supports its own HList abstraction 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.

  • Soft inserts are now the default, i.e. AutoInc columns are automatically skipped when inserting with +=, ++=, insert and insertAll. This means that you no longer need separate projections (without the primary key) for inserts. There are separate methods forceInsert and forceInsertAll in JdbcProfile for the old behavior.

  • A new model for pre-compiled queries replaces the old QueryTemplate abstraction. Any query (both, actual collection-valued Query objects and scalar queries) or function from Column types to such a query can now be lifted into a Compiled wrapper. Lifted functions can be applied (without having to recompile the query), and you can use both monadic composition of Compiled values or just get the underlying query and use that for further composition. Pre-compiled queries can now be used for update and delete operations in addition to querying.

  • threadLocalSession has been renamed to dynamicSession and the corresponding methods have distinct names (e.g. withDynSession vs the standard withSession). This allows the use of the standard methods without extra type annotations.

  • Support for server-side Option conversions (e.g. .getOrElse on a computed Option column)

  • Some changes to the API to bring it closer to Scala Collections syntax.

  • Improved direct embedding.

  • Query scheduling, based on a new query interpreter and in-memory driver, allows the use of tables from multiple databases in a single query. (This is an experimental feature which will undergo further optimization in a future release.)

  • The code generator phase has been incorporated into the query compiler.

  • Full type information is now available in query ASTs. Some important parts of the query compiler have been rewritten to make use of this information. Column flattening and the emulation of Boolean which is required by some databases should now be more robust.

The Slick Extensions package with closed-source drivers for Oracle, DB/2 and SQL Server has been published to the Typesafe repository. The Slick Examples and Slick Testkit Example projects on github have been updated as well.

Here is a complete list of changes since Slick 1.0.1:
  • 6c7d503 Update build for 2.0.0 final
  • 69c32d1 Merge remote-tracking branch ‘origin/pr/615’
  • 6cb28cb Workaround for HList compilation problems in Scala 2.10.3, 2.11.0-M7.
  • 91d810f Modify wrong sentence.
  • e22610d add slf4j and slick examples
  • 5e242e0 Change generated code to not require macros (for IntelliJ compat)
  • 6749e18 Fixed typo in extensions.rst
  • f00287f Bump some docs versions to 2.0.0-RC1
  • 713ede1 Skip indices on postgres when referring to oid for now
  • 038f178 Finish RC1, fix some docs, add codegen docs
  • c5f9d40 Compatibility with Slick extensions
  • 1400a97 manual SQL to plain SQL
  • 9402d24 Fix logging for code generator
  • 38046af Improve scaladoc output (src links, start page, pkg docs)
  • df6e479 Fix unwanted dependency on scala reflect
  • d12055c Add code generator for models (aka type-providers)
  • f3e8764 Add meta model and creation from jdbc meta data
  • b882159 Fix withDynTransaction.
  • 0b173e3 Fix driver bugs and add some scaladoc
  • 79082b0 Rename Invoker.to to Invoker.buildColl and deprecate the old name.
  • 36aaabd Getting Started improvements
  • de547cb Introduction updates
  • 8381de5 Refactoring of the user manual.
  • 520de0b Improved Lifted Embedding documentation.
  • 6e89525 Add migration guide 1.0 -> 2.0
  • a16715b Add docs for quoteIdentifier
  • d4bb06b Allow UnshapedQueryExecutor to be extended by profiles.
  • 48b0184 Fix the waffle badge to show the correct count
  • 1050f13 Improve applicability of .run and .list
  • 4512c11 Update documentation for Lifted Embedding
  • 07d8414 Fix links in documentation.
  • 2c5faff Simple mechanism for mapping custom column types.
  • 006d8a7 Move JdbcType into the cake and abstract it to RelationalProfile
  • 9cdc64b Only peek at the node type for logging.
  • ce471b5 Make TableQuery extensible.
  • d831885 add waffle.io badge
  • e1f38fd Move SQL Server driver from Slick to Slick Extensions
  • b70a2c7 Update build for 2.0.0-M3
  • 1c488ea Deprecate notIn, add filterNot for orthogonality and conformity with Scala collections
  • d1849b8 Add a separate compiler phase for boolean emulation.
  • 32e8cee bumped scala to 2.10.3, sbt to 0.13.0, mima to 0.1.6
  • 24b0ed7 Fix existing doctests, execute all doctests (including required fixes)
  • 2a4d156 Fix fusion of Take and Drop operators.
  • 3464b5e Fix compilation error introduced by merging #232 and #243 together.
  • 48f0648 Add test case for multi-level mapping with <>, prompted by issue #78.
  • c2eb8da Add createDDLInvoker (similar to createInsertInvoker).
  • c897ad9 Add HList and Nat implementations with Shapes for the HList.
  • d6428b7 Simplify custom Shape definitions
  • 99f19fc Use bind variables for types which do not support literals.
  • 68996f0 Skip AutoInc columns by default when inserting data.
  • bda93a7 Introduce “Compiled” computations to replace parameterized queries.
  • 4ee1c5c Treat Unit as an empty product type.
  • bbf9694 Add a common abstraction for literal and parameter columns.
  • b8eaa59 Improve Shape encoding to support Columns-level Shapes.
  • 942d98f Add a nested Shape for Queries.
  • f16915d Allow unit tests which assure that some code does not type-check.
  • ff992bb Add Shape levels to differentiate between flat and nested Shapes.
  • e9d6f69 Running a query to match a specific UUID in MySQL fails in 1.0.1
  • 1c1bf30 Fuse simple mappings before resolving GroupBy.
  • 009dc35 Flatten nested ProductNodes in GroupBy keys.
  • 01410cd Use fixed version numbers for fmpp’s dependencies.
  • d054bf5 Rename .elements to .iterator.
  • 64b1a12 Allow identity (primary key auto-increment) types to be overridden.
  • 2721a90 Quote the table name correctly in InsertBuilder.
  • 1be8a52 Add hashCode() implementation to ProductValue.
  • 5be75d3 Add regression test for grouping by 3 columns.
  • 05ded5c Add documentation about using connection pools.
  • 57d886f Update documentation for new table definitions and tuple syntax.
  • b28d2a1 Fix build for building against Scala 2.11
  • 74ecd59 Don’t mark types as observed in dumps and when building typed copies.
  • 56cdd2d Fix MatchError in tree dumps.
  • 3efe3d6 Fix typos
  • 81e50a7 Fix code style, transaction example, line wrap, search button layout, typos
  • 8829bf9 updates docs to not show dynamicSession as default
  • 621947a adjusted docs to match changes regarding dynamicSession in 83d4707
  • 98eee6d fixes compilation errors in dockets:test (which somehow creeped in)
  • 5bb13eb adjusted docs for OSX
  • c3b771a Add Google Analytics token to the generated docs fixes assembla ticket #188
  • d755e69 added connection / transaction docs
  • a67ca6c changed to docs Slick theme
  • e75919e prepare for theme change (code lines < 100 chars)
  • fa3c659 Add some scaladoc comments to the lifted embedding.
  • 353a260 Update the Typesafe Project & Developer Guidelines.
  • 27fc9ca Remove some cruft from the AST.
  • 5bc8d29 Implement the new column expansion and flattening scheme.
  • 7b114bf Find all referenced table columns in inferTypes.
  • 29fc842 Create a TableExpansion when creating a TableNode.
  • 697dc78 Simplify tagging and ref encoding.
  • e33ba26 Simplify the Shape API + implementation and MapperTest
  • e0c8db6 Support for easy type mapping in Shapes.
  • 9e566e2 Remove Node.apply and rename NodeGenerator.nodeDelegate to .toNode.
  • 379b649 Move the conversion of values to Nodes into Shape.
  • 78bad9e Move encodeRef functionality for container types into Shape.
  • 5e98612 Simplify the creation of packed Shape of QueryParameters.
  • db9116d Slick 2.0.0-M2 release
  • 531607d fixes doctest:test compilation errors introduced by 83d4707
  • 36f95d7 Use the ++ operator for unionAll.
  • 5978155 Allow the use of += and ++= for more complex inserts in JdbcProfile.
  • b16cbc5 Improve threadLocalSession API
  • 6cd987e Make tuple extension methods optional.
  • 820670b Sprinkle some macro sugar on TableQuery.
  • 6a3467e Introduce the new table model.
  • 5506063 Add query-based DDL and Insert APIs.
  • cf1b244 Complete separation of Nodes and Reps.
  • 2f6e031 Disentangle lifted embedding tables from TableNodes.
  • 73c79b3 Remove WithOp.
  • cd1e60c Rebase topic/tuples-everywhere.
  • 8239fb7 Simplify typing of Nodes.
  • 2b45d1f Bump version number to 2.0.0-M1
  • 64e1f6b Some minor cleanup work
  • a63846d Remove “by” Symbol from GroupBy.
  • 11afbd6 Implement SQL-like count(*) semantics workaround in QueryInterpreter.
  • 83c487d Improve handling of types in the AST and query compiler.
  • 65a0c21 Remove TableSymbol.
  • aa88230 A simpler encoding of ‘from’ refs in Query objects.
  • 96c338c A first working version of distributed querying.
  • ca7b178 Simplify the early query compiler phases
  • 8aa7242 Move assignTypes phase further up
  • 8b15dee Add DistributedProfile/Driver/Backend.
  • 3a6202a Clean up cname/confName confusion in TestKit
  • 400c5b6 Switch UnionTest and TemplateTest to RelationalProfile.
  • 1429ebc Split up ScalarFunctionTest into Relational and Jdbc parts.
  • 65c94ab Switch PagingTest and PrimaryKeyTest to RelationalProfile.
  • a09b77c Switch NestingTest and NewQuerySemanticsTest to RelationalProfile.
  • 67582b4 Split MiscTest into RelationalMiscTest and JdbcMiscTest.
  • 688961a Switch ColumnDefaultTest and ForeignKeyTest to RelationalProfile.
  • 8008e34 Make joins work in QueryInterpreter.
  • 6e3dc09 Move BigDecimal support and ColumnType aliases up to RelationalProfile.
  • e5e0b53 First cut of HeapBackend + MemoryProfile implementations.
  • b5ffa2f Refactor code generator + insert compiler phases
  • 7aafec5 Add insertion to BasicProfile.
  • 44cdd0c Move more functionality up to Basic/Relational/SqlProfile.
  • 378d2e0 Move Table and Sequence into RelationalProfile, DDL into BasicProfile.
  • d74c374 Move QueryTemplate functionality up into BasicProfile.
  • 035e809 TestKit refactoring to support non-JdbcDriver tests.
  • 394b83f Create a new RelationalProfile for relational non-SQL data stores.
  • 45ea275 direct embedding: renamed -> annotation to slickOp(erator)
  • fb0f32d direct embedding: added meaningful tests for   and &&. Remove incomplete implementation of size.
  • 33b053e direct embedding: symbol based mapping of main methods
  • 9645133 direct embedding refactoring
  • 654c3c5 direct embedding: symbol-based and easier to read method mapping scala to slick
  • 159125f direct embedding: mapping to more generic slick types
  • ae4f087 New test case for issue #36, works as intended.
  • a180000 matching column types via symbols instead of names
  • 421c6e3 Update the syntax used by the documentation snippets.
  • 6e839c6 Propagate the type of “count” operations through the query compiler.
  • 2e5dc1b Throw an exception when trying to lift a bound table row to a Query.
  • bf45e42 Revert cd8cbea due to broken build.
  • cd8cbea direct embedding match tuples via symbols
  • 0603804 Set path to databases.properties through system property.
  • 237306c Remove Filter nodes with a LiteralNode(true) as the filter condition.
  • a81db73 Add the title and version at the generated API doc
  • 90abb12 added type mapping to direct embedding (fixes tests)
  • 06e058e Further marginalization of Columns.
  • 06bec9b Remove the old type encoding.
  • 518a498 Remove dependency on linearizers from constraint handling and templates.
  • de5c5b1 Bring the design of InsertInvoker closer to the other invokers.
  • 1b0c3b8 Use the new JdbcCodeGen phase for UpdateInvoker
  • 3467dcb Use the new JdbcCodeGen phase for DeleteInvoker
  • 09d17aa Switch QueryExecutor over to the new execution model.
  • 12c746e Add the ability to perform result set updates to the compiled mappings.
  • f0a28ba Compile client-side mapping to JDBC-specific conversion functions.
  • 3d17ecb Encode MappedProjections in the AST.
  • cef0c6c Add option for setting a build target dir.
  • da1f305 Make the test run on Access via JdbcOdbcDriver again.
  • 607a788 Make Invoker a subtype of Function1
  • f35a8d9 Update src/main/scala/scala/slick/util/iter/Iteratee.scala
  • c652c17 Make convertToComprehensions work on typed trees.
  • c6c968f Bug fix: Memoize on the target node instead of the ref in localizeRefs.
  • 1008bf2 Remove an unnecessary createSelect() call in comprehension fusion.
  • 4398eaf Make fuseComprehensions work on typed trees
  • 88d6029 Bug fix: Reuse SymbolNamer when copying the CompilerState
  • df1735b Make fixRowNumberOrdering work on typed trees
  • 36c4882 Remove mutability from QueryCompiler state (except for the SymbolNamer)
  • 96bab55 Proper translation of Option conversions into SQL.
  • c76e1fc Hoist client ops up into ResultSetMapping and make that fully typed.
  • ecf304a Preserve column type information in some compiler phases.
  • d5fa2aa Add “Self” type to Node for better return types.
  • ef9bd95 Replace ExtendedProfile and ExtendedDriver with deprecated type aliases.
  • 90c3e37 Pass fully compiled ASTs to invokers and executors.
  • 51096f6 Remove OldTest.
  • 53af1c5 Add codeGen phase to generate SQL code within the AST.
  • 1626447 Encode Option conversions into the AST and remove deprecated methods.
  • 0a9dea6 direct embedding null ordering support
  • 5f63606 direct embedding better exceptions for wrong use of internal functions
  • fa64ec1 reverse ordering for direct embedding/collections (aka descending)
  • 1a20e72 direct embedding sortBy (ignoring Ordering[_]) for now limited to scalar values and tuples
  • 8f2b270 direct embedding now supports nullable/Option
  • b2cd356 Fix import to use scala.slick instead of slick
  • 53215d2 refactored QueryableTest
  • eb8cbad direct embedding: added drop and take
  • 9fbbf3b ! and != support for direct embedding
  • c5f16b7 Use the shiny new type information in the query AST for better casts.
  • bee3333 Fix typing of Comprehension nodes & assign types after relational phases.
  • 4b5ebea Build against Scala 2.10.0-RC3 and bump Slick version
  • faaa4a7 Narrow down ProductNode.apply to require a Seq[Node]
  • 2c198c1 Keep type information in all AST nodes.
  • 1603604 Expose local scala home as a system property.
  • f346209 Enable building against locally compiled Scala version.
  • 32a65f7 Remove deprecated features
  • bec5613 Allow fusion if the inner Comprehension is a Union wrapper.
  • 797e811 Remove old-style aggregation functions.
  • df40f1d Fix lifting of aggregation functions which reference other generators.
  • 2f7b933 Fix statement logging (broken by the backend refactoring)
  • 21bef4c Bug fix: Correctly relabel selects of implicit joins in relabelUnions.
  • 2271685 Simplify DefNode: No need to implement nodePostGeneratorChildren any more
  • e7458ce Simplify RefNode: Only one Symbol per Node allowed
  • a568b8f Remove the non-“Simple” Node, DefNode and RefNode versions.
  • 02cf916 Remove nodeMapNodes and simplify mapOrNone
  • 02d5224 Simplify construction of typed standard library calls
  • 47c98ac Fix op handling in Column.forNode and use this instead of WrappedColumn.
  • af0aca8 Remove TypeMapper abstraction.
  • df2060c Always perform TypeMapperDelegate lookup through typeInfoFor
  • 2371e05 Further preparations for moving type information into the AST
  • 2b4c49c Further disentanglement of AST/compiler and lifted embedding.
  • 81ab87a Print types of Typed nodes in AST dumps
  • 04a47b5 Add type information to all standard library calls
  • d7cb723 Allow building with JDK 6 and JDK 7
  • 4dfddde Remove some cruft
  • b37ca03 Move SQL utils down from JdbcProfile to SqlProfile
  • e172ea2 Refactor BasicProfile into BasicProfile, SqlProfile and JdbcProfile
  • 6d0f93c Expose Database in JDBC Session and add UnmanagedSession
  • b3c672d Don’t use path-dependent types for the Backend from the Driver.
  • 94a5587 Backend cake with path-dependent types in driver - almost working.

Past News Items

Aug 16 2022
If you use Slick, please try 3.4.0-RC3 by changing the version in your build. After a week, if no regressions have been reported we will G-d willing release 3.4.0 (final)....
Apr 23 2021
Slick is community-maintained. Planning for future releases, including for Scala 3, is in progress. Please help if you can! For details, visit [this ticket](https://github.com/slick/slick/issues/2198).
Sep 09 2020
We have just released Slick 3.3.3 You can find the source code here: . Builds for Scala 2.11, 2.12 and 2.13 are available from Maven Central, as usual. ## Highlights...
Jan 30 2019
We have just released Slick 3.3.0 You can find the source code here: . Builds for Scala 2.11 and 2.12 are available from Maven Central, as usual. ## These are...
Mar 23 2018
We have just released Slick 3.2.3. You can find the source code here: . Builds for Scala 2.11 and 2.12 are available from Maven Central, as usual. From 3.2.0 on,...
Mar 06 2018
We have just released Slick 3.2.2. You can find the source code here: . Builds for Scala 2.11 and 2.12 are available from Maven Central, as usual. From 3.2.0 on,...
Jul 20 2017
We have just released Slick 3.2.1. You can find the source code here: . Builds for Scala 2.11 and 2.12 are available from Maven Central, as usual. From 3.2.0 on,...
Feb 24 2017
We have just released Slick 3.2.0. You can find the source code here: . Builds for Scala 2.11 and 2.12 are available from Maven Central, as usual. From this release...