The .?
operator in the first one allows you to defer the choice of having your field be optional to the moment of defining your projections. Sometimes that's not what you want, but defining your PK to be an Option
is perhaps a bit funny because one might expect a PK to be NOT NULL
.
You can use .?
in additional projections besides *
, for example:
def partial = id.? ~ fname
Then you could do Users.partial.insert(None, "Jacobus")
and not worry about fields you're not interested in.