slick/slick — pull request #905 by szeiger (2014-07-11 14:26:20+00:00)
Title: Remove the Column type.

To @cvogt (and anyone else who follows our PR queue): I'm creating this PR for a preliminary review. We shouldn't merge it until it is clear that this is the right path towards nested and multi-column Options:

A `Column[T]` is a `Rep[T : TypedType]` (or, in the context of code
using a driver, more appropriately a `Rep[T : ColumnType]`). Requiring
a separate type `Column` makes it hard to extend the Lifted Embedding
with features like nested Options and multi-column Options (you cannot
simply lift a `Rep[T]` to a `Rep[Option[T]]` because an Option of a
primitive value would have to be a Column but an Option of anything else
would fall back to being a Rep).

- Remove all dependencies on Column and replace them with Rep, in
particular in: extension methods, CanBeQueryCondition, Case,
OptionMapper, ColumnOrdered, TupleSupport

- Deprecate the implicit conversion from Column[T] to Column[Option[T]].
This is only semi-related to this change but seems to be a good idea.
A few unit tests and the code generator relied on this conversion for
foreign key definitions. These are made explicit now, using `.?` for
Option-lifting.

- Change CanBeQueryCondition, Case, OptionMapper, ColumnOrdered and
TupleSupport to use Rep.

- Provide a Shape for Rep-based columns and remove the old one.

- Make primitive types pack to ConstColumn instead of Column. This makes
sense even without the rest of this refactoring. A primitive value is
always an execution-time constant.

- Make Column[T] a deprecated alias of Rep[T].

- Remove unnecessary Column subtypes (Case.TypedCaseWithElse,
ParameterColumn) entirely.

The downside of this refatoring: `sbt test:compile` (after a previous
`sbt clean update`) is up from 115s to 124s, destroying the performance
advantage we got from the previous refactoring in #832. It looks like it
should be possible to move the shapes for AbstractTable and ConstColumn
to the respective companion objects but this always leads to ambiguous
implicits (with repColumnShape). I don’t understand why it works for the
ShapedValue shape but not for these two.