I added so the DB.php is aware of database config files in packages.
This way if a package is containing a database.php file in its config folder this will be
parset alongside the aplication/config/database.php file.
diff --git a/system/database/DB.php b/system/database/DB.php
index 00d14b4..fd5cf55 100644
--- a/system/database/DB.php
+++ b/system/database/DB.php
@@ -47,6 +47,21 @@
 		}
 
 		include($file_path);
+		//make packages contain database config files
+		foreach(get_instance()->load->get_package_paths() as $path)
+                {
+                    if ($path != APPPATH)
+                        {
+                        if ( file_exists($file_path = $path.'config/'.ENVIRONMENT.'/database.php'))
+                        {
+                            include($file_path);
+                        }
+                        elseif ( file_exists($file_path = $path.'config/database.php'))
+                        {
+                            include($file_path);
+                        }
+                    }
+                }
 
 		if ( ! isset($db) OR count($db) === 0)
 		{
@@ -166,4 +181,4 @@
 }
 
 /* End of file DB.php */
-/* Location: ./system/database/DB.php */
\ No newline at end of file
+/* Location: ./system/database/DB.php */