![]() |
Sometimes it is necessary to use a raw sql query as part of the main query.
I already suggested this, but as part of other changes. And now I would like to know your opinion on the implementation of this as an independent tool. This solution will help bypass the unwanted raw sql processing and use it as is. PHP Code: class SQLExpression Usage PHP Code: $db->select(sql('a + b AS c')); // Raw sql detection PHP Code: public function from($from, bool $overwrite = false)
I think that would add a lot a flexibility for more complex queries. Good idea!
![]()
Thank you.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I have not yet created a helper function.
Do you need it?
Since v4.2.0,
QueryBuilder select(), where(), like(), join() and DBForge::addField() default value accept the RawSql instance. See https://codeigniter4.github.io/CodeIgnit...l#database |
Welcome Guest, Not a member yet? Register Sign In |