Closed GregJArnold closed 5 years ago
Sorry, I just see your PR. The format you use to tell the API it is a literal SQL is the array but it might conflict with values being real arrays. (it appears this case is not tested since you did not make any test to fail).
IMHO, one way to do it would be to pass a LiteralSQLExpression
instance containing the expression (to be implemented) that would be treated as such.
That makes sense, and seems like the cleanest solution. I'll re-work it as such.
This allows you to specify literal SQL in updates and creates. As an example, to update a row's timestamp
$model->updateByPk([ 'id' => $id ], [ modifiedAt => [ 'NOW()' ] ]);