Added function to get database from namespace