MasoniteFramework / orm

Masonite ORM is a beautiful Python ORM. It's also a nearly drop in replacement of the Orator ORM
https://orm.masoniteproject.com
MIT License
160 stars 47 forks source link

Adds function increment_each. This allows specifying multiple columns to increment by #836

Closed JarriqTheTechie closed 7 months ago

JarriqTheTechie commented 1 year ago

Adds function increment_each. This allows specifying multiple columns to increment by

e.g.

The following will increment the users age by 5 and its children by 10.

User.find(1).increment_each([ {"age": 5}, {"children", 10} ])

the result of the action returns either model or a querybuilder

This change also rewrites the original increment function to use the new increment_each function. The function signature remains intact.

JarriqTheTechie commented 1 year ago

@josephmancuso please review. If this is merged I'll create a PR for decrement_each also.

yubarajshrestha commented 7 months ago

@JarriqTheTechie fix the conflicts.

JarriqTheTechie commented 7 months ago

I will work on correcting the conflicts and writing some tests this week if time permits.

JarriqTheTechie commented 7 months ago

Closing this PR. Will open a new one.