more db functions
starting with unit tests for database