database functions file