postutil.js - pull out db functionality