Allow Query to return a database cursor (Thanks to Machinarius)