Updating a field value using Ecto

You can do a separate query fetching NOW() before updating the entry, or do that with a single query with Repo.update_all/3, there is literally a example with fragment in the documentation:

from(p in Post, where: p.id < 10, update: [set: [title: fragment("upper(?)", ^new_title)]])
|> MyRepo.update_all([])
2 Likes