In reply to David.

Hi David,

WordPress alows to replace some functions with Dropins, and one of them is the DB.

In wp-settings.php line 87 we have:
// Include the wpdb class and, if present, a db.php database drop-in.
require_wp_db();

I don't know much about it, just to let you know.