Prototype for DB queries