Parsed documentation:
View on GitHub
A lock query expression.

Provides support for row-level pessimistic locking using
`SELECT ... FOR UPDATE` or other, database-specific, locking clauses.
`expr` can be any expression but has to evaluate to a boolean value or to a
string and it can't include any fields.

If `lock` is used more than once, the last one used takes precedence.

Ecto also supports [optimistic
locking]( but not
through queries. For more information on optimistic locking, have a look at
the `Ecto.Model.OptimisticLock` module.

## Keywords examples

    from(u in User, where: == ^current_user, lock: "FOR SHARE NOWAIT")

## Expressions examples

    User |> where( == ^current_user) |> lock("FOR SHARE NOWAIT")
Please help! Open an issue on GitHub if this assessment is incorrect.