laravel-registry icon indicating copy to clipboard operation
laravel-registry copied to clipboard

Registry::store() doesn't work with SQLite

Open pacoorozco opened this issue 9 years ago • 1 comments

The Registry::store() method uses a prepared statement with a hardcoded table name (see #14), but also it uses ON DUPLICATE KEY... which doesn't exist on SQLite:

$this->database->statement("INSERT INTO system_registries ( `key`, `value` ) VALUES ( ?, ? ) ON  DUPLICATE KEY UPDATE `key` = ?, `value` = ?",
    array($key, $jsonValue, $key, $jsonValue));

This causes the method to not work if you use SQLite as database. It should use some other methods like these ones.

pacoorozco avatar Sep 02 '16 09:09 pacoorozco

I think you can modify this line, will solve #14 and this one, for:

$this->database->statement("INSERT OR REPLACE INTO ".$this->config['table']." ( `key`, `value` ) VALUES ( ?, ? )", array($key, $jsonValue));

pacoorozco avatar Sep 02 '16 10:09 pacoorozco