public function queryMap($key = 0, $value = 1)
	{
		$fetchMode = $this->resolveFetchMode(is_string($key) || is_string($value));
		$result = $this->execute();
		$map = [];
		
		try
		{
			while ($row = $result->fetch($fetchMode))
			{
				if (!isset($row[$key]) || !key_exists($value, $row)) 
					throw new MySqlException(
						"Key '$key' or Value '$value' columns not found in the query result: " . 
						implode(array_keys($row)));
				
				$map[$row[$key]] = $row[$value];
			}
		}
		// Free resources when generator released before reaching the end of the iteration.
		finally
		{
			$result->closeCursor();
		}
		
		return $map;
	}