public function offsetSet($offset, $value): Row
    {
        //Insert on missing offset
        if ($offset === null) {
            $value['id'] = null;

            return $this->create($value)->save();
        }

        //Update if the element is cached and exists
        $row = $this->getCached($offset);

        if ($row) {
            return $row->edit($value)->save();
        }

        //Update if the element it's not cached
        if (!$this->isCached($row)) {
            $this->update()
                ->columns($value)
                ->where('id = ', $offset)
                ->run();
        }
    }