iksaku / laravel-mass-update

Update multiple Laravel Model records, each with its own set of values, sending a single query to your database!
MIT License
124 stars 11 forks source link

Error updating boolean values using PostgreSQL #15

Open javebers opened 6 days ago

javebers commented 6 days ago

Boolean values ​​are being cast to int, wich works with MySQL but throws an error when using PostgreSQL. Postgres accepts '0' and '1' as strings, but not as integers, from what I understand.

Otherwise it works great. Thanks for the work you put into this. πŸ‘

iksaku commented 3 days ago

Thanks for the feedback!

My first idea is that there should be some kind of function to automatically handle primitives. Hopefully in PDO or similar. I'll take a look at it

iksaku commented 3 days ago

Found a built-in method ✨: https://github.com/laravel/framework/blob/v10.13.0/src/Illuminate/Database/Grammar.php#L213

The only problem is that it requires Laravel >=10.13 and we currently bring support for version 8.

Good enough excuse to take a look at v2 of the package. Will look for some time next week to work through this.