Skip to content

feat: support add_<field> for integer fields #74

@lrstanley

Description

@lrstanley

✨ Describe the feature you'd like

Ent integer fields which are immutable support integer addition. This is to allow incrementing the number without knowing the existing number ahead of time, and/or to cover the scenario of incrementing the number without being able to do it in a transaction and losing potential data.

Example:

// AddViewCount adds i to the "view_count" field.
func (pu *PostUpdate) AddViewCount(i int) *PostUpdate {
	pu.mutation.AddViewCount(i)
	return pu
}

⚠ If implemented, do you think this feature will be a breaking change to users?

No

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions