Slick 2.0.0
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
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. -
Soft inserts are now the default, i.e.
AutoInccolumns are automatically skipped when inserting with+=,++=,insertandinsertAll. This means that you no longer need separate projections (without the primary key) for inserts. There are separate methodsforceInsertandforceInsertAllinJdbcProfilefor the old behavior. -
A new model for pre-compiled queries replaces the old
QueryTemplateabstraction. Any query (both, actual collection-valuedQueryobjects and scalar queries) or function fromColumntypes to such a query can now be lifted into aCompiledwrapper. Lifted functions can be applied (without having to recompile the query), and you can use both monadic composition ofCompiledvalues 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. -
threadLocalSessionhas been renamed todynamicSessionand the corresponding methods have distinct names (e.g.withDynSessionvs the standardwithSession). 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
Booleanwhich 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:
6c7d503Update build for 2.0.0 final69c32d1Merge remote-tracking branch ‘origin/pr/615’6cb28cbWorkaround for HList compilation problems in Scala 2.10.3, 2.11.0-M7.91d810fModify wrong sentence.e22610dadd slf4j and slick examples5e242e0Change generated code to not require macros (for IntelliJ compat)6749e18Fixed typo in extensions.rstf00287fBump some docs versions to 2.0.0-RC1713ede1Skip indices on postgres when referring to oid for now038f178Finish RC1, fix some docs, add codegen docsc5f9d40Compatibility with Slick extensions1400a97manual SQL to plain SQL9402d24Fix logging for code generator38046afImprove scaladoc output (src links, start page, pkg docs)df6e479Fix unwanted dependency on scala reflectd12055cAdd code generator for models (aka type-providers)f3e8764Add meta model and creation from jdbc meta datab882159Fix withDynTransaction.0b173e3Fix driver bugs and add some scaladoc79082b0Rename Invoker.to to Invoker.buildColl and deprecate the old name.36aaabdGetting Started improvementsde547cbIntroduction updates8381de5Refactoring of the user manual.520de0bImproved Lifted Embedding documentation.6e89525Add migration guide 1.0 -> 2.0a16715bAdd docs for quoteIdentifierd4bb06bAllow UnshapedQueryExecutor to be extended by profiles.48b0184Fix the waffle badge to show the correct count1050f13Improve applicability of .run and .list4512c11Update documentation for Lifted Embedding07d8414Fix links in documentation.2c5faffSimple mechanism for mapping custom column types.006d8a7Move JdbcType into the cake and abstract it to RelationalProfile9cdc64bOnly peek at the node type for logging.ce471b5Make TableQuery extensible.d831885add waffle.io badgee1f38fdMove SQL Server driver from Slick to Slick Extensionsb70a2c7Update build for 2.0.0-M31c488eaDeprecate notIn, add filterNot for orthogonality and conformity with Scala collectionsd1849b8Add a separate compiler phase for boolean emulation.32e8ceebumped scala to 2.10.3, sbt to 0.13.0, mima to 0.1.624b0ed7Fix 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 definitions99f19fcUse 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.11c1bf30Fuse 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.1174ecd59Don’t mark types as observed in dumps and when building typed copies.56cdd2dFix MatchError in tree dumps.3efe3d6Fix typos81e50a7Fix code style, transaction example, line wrap, search button layout, typos8829bf9updates docs to not show dynamicSession as default621947aadjusted docs to match changes regarding dynamicSession in 83d470798eee6dfixes compilation errors in dockets:test (which somehow creeped in)5bb13ebadjusted docs for OSXc3b771aAdd Google Analytics token to the generated docs fixes assembla ticket #188d755e69added connection / transaction docsa67ca6cchanged to docs Slick themee75919eprepare 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 MapperTeste0c8db6Support 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.db9116dSlick 2.0.0-M2 release531607dfixes doctest:test compilation errors introduced by 83d470736f95d7Use the ++ operator for unionAll.5978155Allow the use of += and ++= for more complex inserts in JdbcProfile.b16cbc5Improve threadLocalSession API6cd987eMake 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.73c79b3Remove WithOp.cd1e60cRebase topic/tuples-everywhere.8239fb7Simplify typing of Nodes.2b45d1fBump version number to 2.0.0-M164e1f6bSome minor cleanup worka63846dRemove “by” Symbol from GroupBy.11afbd6Implement SQL-likecount(*)semantics workaround in QueryInterpreter.83c487dImprove handling of types in the AST and query compiler.65a0c21Remove TableSymbol.aa88230A simpler encoding of ‘from’ refs in Query objects.96c338cA first working version of distributed querying.ca7b178Simplify the early query compiler phases8aa7242Move assignTypes phase further up8b15deeAdd DistributedProfile/Driver/Backend.3a6202aClean up cname/confName confusion in TestKit400c5b6Switch UnionTest and TemplateTest to RelationalProfile.1429ebcSplit up ScalarFunctionTest into Relational and Jdbc parts.65c94abSwitch PagingTest and PrimaryKeyTest to RelationalProfile.a09b77cSwitch NestingTest and NewQuerySemanticsTest to RelationalProfile.67582b4Split MiscTest into RelationalMiscTest and JdbcMiscTest.688961aSwitch ColumnDefaultTest and ForeignKeyTest to RelationalProfile.8008e34Make joins work in QueryInterpreter.6e3dc09Move BigDecimal support and ColumnType aliases up to RelationalProfile.e5e0b53First cut of HeapBackend + MemoryProfile implementations.b5ffa2fRefactor code generator + insert compiler phases7aafec5Add insertion to BasicProfile.44cdd0cMove more functionality up to Basic/Relational/SqlProfile.378d2e0Move Table and Sequence into RelationalProfile, DDL into BasicProfile.d74c374Move QueryTemplate functionality up into BasicProfile.035e809TestKit refactoring to support non-JdbcDriver tests.394b83fCreate a new RelationalProfile for relational non-SQL data stores.45ea275direct embedding: renamed -> annotation to slickOp(erator)-
fb0f32ddirect embedding: added meaningful tests forand &&. Remove incomplete implementation of size. 33b053edirect embedding: symbol based mapping of main methods9645133direct embedding refactoring654c3c5direct embedding: symbol-based and easier to read method mapping scala to slick159125fdirect embedding: mapping to more generic slick typesae4f087New test case for issue #36, works as intended.a180000matching column types via symbols instead of names421c6e3Update the syntax used by the documentation snippets.6e839c6Propagate the type of “count” operations through the query compiler.2e5dc1bThrow an exception when trying to lift a bound table row to a Query.bf45e42Revertcd8cbeadue to broken build.cd8cbeadirect embedding match tuples via symbols0603804Set path to databases.properties through system property.237306cRemove Filter nodes with a LiteralNode(true) as the filter condition.a81db73Add the title and version at the generated API doc90abb12added type mapping to direct embedding (fixes tests)06e058eFurther marginalization of Columns.06bec9bRemove the old type encoding.518a498Remove dependency on linearizers from constraint handling and templates.de5c5b1Bring the design of InsertInvoker closer to the other invokers.1b0c3b8Use the new JdbcCodeGen phase for UpdateInvoker3467dcbUse the new JdbcCodeGen phase for DeleteInvoker09d17aaSwitch QueryExecutor over to the new execution model.12c746eAdd the ability to perform result set updates to the compiled mappings.f0a28baCompile client-side mapping to JDBC-specific conversion functions.3d17ecbEncode MappedProjections in the AST.cef0c6cAdd option for setting a build target dir.da1f305Make the test run on Access via JdbcOdbcDriver again.607a788Make Invoker a subtype of Function1f35a8d9Update src/main/scala/scala/slick/util/iter/Iteratee.scalac652c17Make convertToComprehensions work on typed trees.c6c968fBug fix: Memoize on the target node instead of the ref in localizeRefs.1008bf2Remove an unnecessary createSelect() call in comprehension fusion.4398eafMake fuseComprehensions work on typed trees88d6029Bug fix: Reuse SymbolNamer when copying the CompilerStatedf1735bMake fixRowNumberOrdering work on typed trees36c4882Remove mutability from QueryCompiler state (except for the SymbolNamer)96bab55Proper translation of Option conversions into SQL.c76e1fcHoist client ops up into ResultSetMapping and make that fully typed.ecf304aPreserve column type information in some compiler phases.d5fa2aaAdd “Self” type to Node for better return types.ef9bd95Replace ExtendedProfile and ExtendedDriver with deprecated type aliases.90c3e37Pass fully compiled ASTs to invokers and executors.51096f6Remove OldTest.53af1c5Add codeGen phase to generate SQL code within the AST.1626447Encode Option conversions into the AST and remove deprecated methods.0a9dea6direct embedding null ordering support5f63606direct embedding better exceptions for wrong use of internal functionsfa64ec1reverse ordering for direct embedding/collections (aka descending)1a20e72direct embedding sortBy (ignoringOrdering[_]) for now limited to scalar values and tuples8f2b270direct embedding now supports nullable/Optionb2cd356Fix import to use scala.slick instead of slick53215d2refactored QueryableTesteb8cbaddirect embedding: added drop and take9fbbf3b! and != support for direct embeddingc5f16b7Use the shiny new type information in the query AST for better casts.bee3333Fix typing of Comprehension nodes & assign types after relational phases.4b5ebeaBuild against Scala 2.10.0-RC3 and bump Slick versionfaaa4a7Narrow down ProductNode.apply to require a Seq[Node]2c198c1Keep type information in all AST nodes.1603604Expose local scala home as a system property.f346209Enable building against locally compiled Scala version.32a65f7Remove deprecated featuresbec5613Allow fusion if the inner Comprehension is a Union wrapper.797e811Remove old-style aggregation functions.df40f1dFix lifting of aggregation functions which reference other generators.2f7b933Fix statement logging (broken by the backend refactoring)21bef4cBug fix: Correctly relabel selects of implicit joins in relabelUnions.2271685Simplify DefNode: No need to implement nodePostGeneratorChildren any moree7458ceSimplify RefNode: Only one Symbol per Node alloweda568b8fRemove the non-“Simple” Node, DefNode and RefNode versions.02cf916Remove nodeMapNodes and simplify mapOrNone02d5224Simplify construction of typed standard library calls47c98acFix op handling in Column.forNode and use this instead of WrappedColumn.af0aca8Remove TypeMapper abstraction.df2060cAlways perform TypeMapperDelegate lookup through typeInfoFor2371e05Further preparations for moving type information into the AST2b4c49cFurther disentanglement of AST/compiler and lifted embedding.81ab87aPrint types of Typed nodes in AST dumps04a47b5Add type information to all standard library callsd7cb723Allow building with JDK 6 and JDK 74dfdddeRemove some cruftb37ca03Move SQL utils down from JdbcProfile to SqlProfilee172ea2Refactor BasicProfile into BasicProfile, SqlProfile and JdbcProfile6d0f93cExpose Database in JDBC Session and add UnmanagedSessionb3c672dDon’t use path-dependent types for the Backend from the Driver.94a5587Backend cake with path-dependent types in driver - almost working.
