Added a global database selector wrapper for multi-tenancy