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
161 stars 47 forks source link

Fix problem with increment and decrement in QueryBuilder #802

Closed LordDeveloper closed 1 year ago

LordDeveloper commented 1 year ago

I have a problem with increment and decrement methods in masonite orm models:

Code:

user.increment('balance', 1000)

Error: image

The problem is related to MYSQL Grammer for missing "," separator in multiple update expressions. Created query:

update `users` set `users`.`balance` = `users`.`balance` + %s ("," is missing here) `users`.`updated_at` = %s

Manually fixed by changing this line: https://github.com/MasoniteFramework/orm/blob/2.0/src/masoniteorm/query/grammars/MySQLGrammar.py#L141

image