public function query($sql, $parameters = [])
    {
        $this->_checkConnection();

        $query = $sql;
        if (is_object($sql)) {
            if (!($sql instanceof SqlInterface)) {
                throw new InvalidArgumentException(
                    "The SQL provided is not a string or does not " .
                    "implements the Slick\Database\Sql\SqlInterface interface."
                );
            }

            $query = $sql->getQueryString();
        }

        try {
            $statement = $this->_handler->prepare($query);
            $start = microtime(true);
            $statement->execute($parameters);
            $end = microtime(true);
            $time = $end - $start;
            $result = $statement->fetchAll($this->_fetchMode);
            $this->getLogger()->info(
                "Query ({$this->connectionName}): Query with results",
                [
                    'query' => $query,
                    'params' => $parameters,
                    'time' => number_format($time, 3),
                    'affected' => $statement->rowCount()
                ]
            );
        } catch (\PDOException $exp) {
            throw new SqlQueryException(
                "An error occurred when querying the database service." .
                "SQL: {$query} " .
                "Error: {$exp->getMessage()} " .
                "Database error: {$this->getLastError()}"
            );
        }

        return new RecordList(['data' => $result]);
    }