public function insertOrUpdate($tableORq, $data)
    {
        if (is_string($tableORq)) {
            $this->defaults['table'] = $tableORq;
            $tableORq = [];
        }
        extract($this->defaults);
        extract($tableORq);

        if (!$table)
            throw new Exception("table [$tabel] not defined", 1);

        $sql =  'INSERT OR REPLACE INTO ' . $table . ' ' .
                '(' . implode(', ', array_keys($data)) . ') ' .
                'VALUES ( :' . implode(', :', array_keys($data)) . ');';

        return $this->query($sql, $data);
    }