Closed ekhaled closed 8 years ago
Hi @ekhaled
It was actually not that simple, because I had to extend the query parser and add a handful exceptions for not escaping sql functions and such. after re-aligning some parts, this new escaping feature should be ready to go. Just give it a try. If something goes wrong, you can disable that identifier escaping by setting CORTEX.quoteConditions = false
in a config file.
This is working very well now, just tested
Hi, I have a table called
order
(don't ask... legacy DB structure :disappointed:) and ahas-many
relation calledorder_history
;when I try to cast the
order
object with reations:$model->cast(null, array('order_history' => 0));
I get the following error:
I know it's because
order
is not being escaped. If you could direct me, I'm happy to send a pull request.Is it enough to hardcode the escaping on line 580 (and other similar lines)?
I have checked and it works, but I don't know how it will affect other supported databases.
Thanks for the awesome ORM.