working db functionality for test chat project