basic db module to handle database operations