public function fetchRow($mode = ARRAY_BOTH) {
        if (!$this->result || $this->nextRowIndex < 0)        // no automatic result reset()
            return null;

        switch ($mode) {
            case ARRAY_ASSOC: $mode = SQLITE3_ASSOC; break;
            case ARRAY_NUM:   $mode = SQLITE3_NUM;   break;
            default:          $mode = SQLITE3_BOTH;
        }

        $row = $this->result->fetchArray($mode);
        if ($row) {
            $this->nextRowIndex++;
        }
        else {
            if ($this->numRows === null)                       // update $numRows on-the-fly if not yet happened
                $this->numRows = $this->nextRowIndex;
            $row                = null;                        // prevent fetchArray() to trigger an automatic reset()
            $this->nextRowIndex = -1;                          // on second $row == null
        }
        return $row;
    }