sql module amended: response with sql content instead of the file object in order to close file after retrieving.