add db testing framwork.

- add pgrest into dependency .
refactory.