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
~: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
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. Pre-compiled queries can now be used for update and delete operations in addition to querying.
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.
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 final
69c32d1Merge 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 examples
5e242e0Change generated code to not require macros (for IntelliJ compat)
6749e18Fixed typo in extensions.rst
f00287fBump some docs versions to 2.0.0-RC1
713ede1Skip indices on postgres when referring to oid for now
038f178Finish RC1, fix some docs, add codegen docs
c5f9d40Compatibility with Slick extensions
1400a97manual SQL to plain SQL
9402d24Fix logging for code generator
38046afImprove scaladoc output (src links, start page, pkg docs)
df6e479Fix unwanted dependency on scala reflect
d12055cAdd code generator for models (aka type-providers)
f3e8764Add meta model and creation from jdbc meta data
0b173e3Fix driver bugs and add some scaladoc
79082b0Rename Invoker.to to Invoker.buildColl and deprecate the old name.
36aaabdGetting Started improvements
8381de5Refactoring of the user manual.
520de0bImproved Lifted Embedding documentation.
6e89525Add migration guide 1.0 -> 2.0
a16715bAdd docs for quoteIdentifier
d4bb06bAllow UnshapedQueryExecutor to be extended by profiles.
48b0184Fix the waffle badge to show the correct count
1050f13Improve applicability of .run and .list
4512c11Update documentation for Lifted Embedding
07d8414Fix links in documentation.
2c5faffSimple mechanism for mapping custom column types.
006d8a7Move JdbcType into the cake and abstract it to RelationalProfile
9cdc64bOnly peek at the node type for logging.
ce471b5Make TableQuery extensible.
d831885add waffle.io badge
e1f38fdMove SQL Server driver from Slick to Slick Extensions
b70a2c7Update build for 2.0.0-M3
1c488eaDeprecate notIn, add filterNot for orthogonality and conformity with Scala collections
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
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 83d4707
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.
db9116dSlick 2.0.0-M2 release
531607dfixes doctest:test compilation errors introduced by 83d4707
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.
2b45d1fBump version number to 2.0.0-M1
64e1f6bSome minor cleanup work
a63846dRemove “by” Symbol from GroupBy.
count(*)semantics workaround in QueryInterpreter.
83c487dImprove handling of types in the AST and query compiler.
aa88230A simpler encoding of ‘from’ refs in Query objects.
96c338cA first working version of distributed querying.
ca7b178Simplify the early query compiler phases
8aa7242Move assignTypes phase further up
3a6202aClean up cname/confName confusion in TestKit
400c5b6Switch 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 phases
7aafec5Add 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 for
and &&. Remove incomplete implementation of size.
33b053edirect embedding: symbol based mapping of main methods
9645133direct embedding refactoring
654c3c5direct embedding: symbol-based and easier to read method mapping scala to slick
159125fdirect embedding: mapping to more generic slick types
ae4f087New test case for issue #36, works as intended.
a180000matching column types via symbols instead of names
421c6e3Update 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.
cd8cbeadue to broken build.
cd8cbeadirect embedding match tuples via symbols
0603804Set 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 doc
90abb12added 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 UpdateInvoker
3467dcbUse the new JdbcCodeGen phase for DeleteInvoker
09d17aaSwitch 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 Function1
c652c17Make 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 trees
88d6029Bug fix: Reuse SymbolNamer when copying the CompilerState
df1735bMake fixRowNumberOrdering work on typed trees
36c4882Remove 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.
53af1c5Add codeGen phase to generate SQL code within the AST.
1626447Encode Option conversions into the AST and remove deprecated methods.
0a9dea6direct embedding null ordering support
5f63606direct embedding better exceptions for wrong use of internal functions
fa64ec1reverse ordering for direct embedding/collections (aka descending)
1a20e72direct embedding sortBy (ignoring
Ordering[_]) for now limited to scalar values and tuples
8f2b270direct embedding now supports nullable/Option
b2cd356Fix import to use scala.slick instead of slick
eb8cbaddirect embedding: added drop and take
9fbbf3b! and != support for direct embedding
c5f16b7Use 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 version
faaa4a7Narrow 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 features
bec5613Allow 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 more
e7458ceSimplify RefNode: Only one Symbol per Node allowed
a568b8fRemove the non-“Simple” Node, DefNode and RefNode versions.
02cf916Remove nodeMapNodes and simplify mapOrNone
02d5224Simplify construction of typed standard library calls
47c98acFix op handling in Column.forNode and use this instead of WrappedColumn.
af0aca8Remove TypeMapper abstraction.
df2060cAlways perform TypeMapperDelegate lookup through typeInfoFor
2371e05Further preparations for moving type information into the AST
2b4c49cFurther disentanglement of AST/compiler and lifted embedding.
81ab87aPrint types of Typed nodes in AST dumps
04a47b5Add type information to all standard library calls
d7cb723Allow building with JDK 6 and JDK 7
4dfdddeRemove some cruft
b37ca03Move SQL utils down from JdbcProfile to SqlProfile
e172ea2Refactor BasicProfile into BasicProfile, SqlProfile and JdbcProfile
6d0f93cExpose Database in JDBC Session and add UnmanagedSession
b3c672dDon’t use path-dependent types for the Backend from the Driver.
94a5587Backend cake with path-dependent types in driver - almost working.