First cut at querying database directly