Added database helper functions.