Added database switch functionality.