CodeIgniter Forums

Full Version: Autoload DB and don't connect until a query is made
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It's handy to be able to autoload the database library but in some cases (webhooks for example) this can cause issues when you're flooded with requests. Since it auto connects even if you have code in place to throttle logic you're still creating and dropping connections to the DB.

The way the DB code is structured it's a bit of a pain to overload the methods necessary to accomplish this. If I make a patch and submit a PR is this something you'd accept as a change? How I go about coding it for myself depends on your likelihood of accepting it as a change for everyone.