process function receives db object