PDO-like DB access, plus helper methods