Adding database utility functions