Extending \CodeIgniter\Database\MySQLi\Builder possible? |
First - extending database classes doesn't work, unfortunately. It's gets messy really fast due to the way the classes are found, so you'd have to basically extend ALL of the MySQLi classes and make it a separate driver. Probably not what you're looking for.
More importantly, though, by default the database connection is shared so no matter how times you call db_connect(), or go directly through CodeIgniter\Database\Config::connect(), you'll get the same instance of the database connection. You always have the option of getting a new instance but the default is to share the connection. Also, you can always get the last query ran, with Code: $query = db_connect()->getLastQuery(); That will return a Query object that you can get the query string and check if a where is in it. You can cast that object as a string to get the final query, or call $query->getQuery(); |
Messages In This Thread |
Extending \CodeIgniter\Database\MySQLi\Builder possible? - by tgix - 08-10-2019, 01:42 AM
RE: Extending \CodeIgniter\Database\MySQLi\Builder possible? - by includebeer - 08-10-2019, 06:56 AM
RE: Extending \CodeIgniter\Database\MySQLi\Builder possible? - by tgix - 08-10-2019, 09:14 AM
RE: Extending \CodeIgniter\Database\MySQLi\Builder possible? - by includebeer - 08-10-2019, 11:52 AM
RE: Extending \CodeIgniter\Database\MySQLi\Builder possible? - by InsiteFX - 08-11-2019, 08:23 AM
RE: Extending \CodeIgniter\Database\MySQLi\Builder possible? - by dave friend - 08-11-2019, 10:02 AM
RE: Extending \CodeIgniter\Database\MySQLi\Builder possible? - by dave friend - 08-11-2019, 10:28 AM
RE: Extending \CodeIgniter\Database\MySQLi\Builder possible? - by kilishan - 08-11-2019, 08:43 PM
RE: Extending \CodeIgniter\Database\MySQLi\Builder possible? - by tgix - 08-11-2019, 09:54 PM
|