Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 4.0 Query Builder and CAST support
#3

(03-14-2020, 03:25 AM)zahhar Wrote: Could you please elaborate on use-case where you need CAST function in mySQL?
Also would be interesting why not to case datatypes in PHP or in your model before feeding them into mySQL?

Overall, I do not think Query Builder should support all possible functions of all DB engines around.
For custom queries you always have free-form query.

Thank you very much for your reply.

I am using datatables.

I am implementing database search and some tables not only contain text fields, but also integers, date and time and more.

If I use the cast function it becomes much simpler, otherwise I think I have to insert an if for each type of field...

I'm not very expert on the subject: if you have any suggestions I would be grateful.

I wouldn't want to write a search-specific query generator when CodeIgniter already has one
Codeigniter 4 - Docker Image [github] [docker hub]
Reply


Messages In This Thread
RE: CodeIgniter 4.0 Query Builder and CAST support - by atsanna - 03-14-2020, 04:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB