Add function to work with databases