public function renameRelation(string $name, string $new) : array
    {
        if (!isset($this->relations[$name])) {
            throw new DBException("Relation not found");
        }
        if (isset($this->relations[$new])) {
            throw new DBException("A relation with that name already exists");
        }
        $temp = $this->relations[$name];
        $temp->name = $new;
        $this->relations[$new] = $temp;
        unset($this->relations[$name]);
        return $this->relations[$new] ?? null;
    }