The doc has an example of the update_values parameter on the on_conflict() method, but the actual implementation is not done yet. please add it.
the doc
Update values
Optionally, the fields to update can be overriden. The default is to update the same fields that were specified in the rows to insert.
Refer to the insert values using the psqlextra.expressions.ExcludedCol expression which translates to PostgreSQL’s EXCLUDED. expression. All expressions and features that can be used with Django’s update() can be used here.
Warning
Specifying an empty update_values ({}) will transform the query into NOTHING. Only None makes the default behaviour kick in of updating all fields that were specified.
The doc has an example of the update_values parameter on the on_conflict() method, but the actual implementation is not done yet. please add it.
the doc Update values Optionally, the fields to update can be overriden. The default is to update the same fields that were specified in the rows to insert.
Refer to the insert values using the psqlextra.expressions.ExcludedCol expression which translates to PostgreSQL’s EXCLUDED. expression. All expressions and features that can be used with Django’s update() can be used here.
Warning Specifying an empty update_values ({}) will transform the query into NOTHING. Only None makes the default behaviour kick in of updating all fields that were specified.
from django.db.models import F
from psqlextra.expressions import ExcludedCol
( MyModel .objects .on_conflict( ['name'], ConflictAction.UPDATE, update_values=dict( name=ExcludedCol('name'), count=F('count') + 1, ), ) .insert( name='henk', count=0, ) )