add db connection to views