test writing to db