staudenmeir / laravel-cte

Laravel queries with common table expressions
MIT License
514 stars 38 forks source link

insertUsing returns true instead of number of rows affected #36

Closed Lundis closed 2 years ago

Lundis commented 2 years ago

insertUsing() should return the number of rows inserted. It now returns true instead. I'm guessing this is an old laravel bug that was copy/pasted into laravel-cte?

laravel-cte's Builder: return $this->connection->insert( laravel's Builder: return $this->connection->affectingStatement(

There are also other differences in the two functions, but I am not familiar enough with the Builder to say if they're intentional or not. laravel does applyBeforeQueryCallbacks() in pretty much all of the functions.

staudenmeir commented 2 years ago

Thanks! I released a new version.

I also added the applyBeforeQueryCallbacks() call, the method was only introduced last year.

Lundis commented 2 years ago

Thanks. We've verified that it works as expected on our end.