Add database-related functions