Added queryToStruct helper function

Added an additional helper function to convert a query result set with a single record to a struct as opposed to an array of length one with a struct.