public function createRange(RangeInterface $range, $type, DateTime $expiration = null)
    {
        $dateTimeFormat = $this->connection->getDatabasePlatform()->getDateTimeFormatString();
        $this->connection->executeQuery(
            '
                INSERT INTO LoginControlIpRanges
                    (lcirIpFrom, lcirIpTo, lcirType, lcirExpires)
                VALUES
                    (?, ?, ?, ?)
            ',
            [
                $range->getComparableStartString(),
                $range->getComparableEndString(),
                $type,
                ($expiration === null) ? null : $expiration->format($dateTimeFormat),
            ]
        );
        $id = $this->connection->lastInsertId();
        $rs = $this->connection->executeQuery('SELECT * FROM LoginControlIpRanges WHERE lcirID = ? LIMIT 1', [$id]);
        $row = $rs->fetch();
        $rs->closeCursor();

        return IPRange::createFromRow($row, $dateTimeFormat);
    }