I tired the following and it worked
from(p in table_name, where: p.subject == ^subject and fragment(“validity @> ?::integer”, ^scn),
update: [set: [validity: fragment(“int4range(lower(validity), ?, ‘[)’)”, ^scn)]])
|> Repo.update_all()
However I am not sure how I can convert the above into batching, it seems like I have to do this for one record at a time, where as the insert below I can provide multiple records in the list and they will be applied as part of a batched prepared statement. Any suggestions I can convert this into a prepared statement batch for update.
Repo.insert_all(table_name, [record, record1])






















