build data frames from db directly