PHP Sqlite allows setting mode and cache parameters. While adding support for cache was straight forward I struggled a little bit with the mode parameter and the options that are currently possible.
Currently for a sqlite connection you can set name and memory options. If memory has been set to anything name is overwritten to :memory:.
https://github.com/cakephp/phinx/blob/master/tests/Phinx/Config/ConfigTest.php#L344
What is the benefit of having the memory option and not specifying :memory: in the name directly?
PHP 8.1+ adds support for using mode query parameter when creating a connection. Wouldn't it be better to keep the name or use the name specified in memory if not true as name for the database?
https://github.com/cakephp/phinx/blob/master/src/Phinx/Db/Adapter/SQLiteAdapter.php#L159
if($options['memory'] !== true && PHP_VERSION_ID >= 80100) {
$options['name'] = $options['memory'];
$params[] = 'mode=memory';
} else {
$options['name'] = static::MEMORY;
}
PHP Sqlite allows setting
modeandcacheparameters. While adding support forcachewas straight forward I struggled a little bit with the mode parameter and the options that are currently possible.Currently for a sqlite connection you can set
nameandmemoryoptions. Ifmemoryhas been set to anythingnameis overwritten to:memory:.https://github.com/cakephp/phinx/blob/master/tests/Phinx/Config/ConfigTest.php#L344
What is the benefit of having the memory option and not specifying
:memory:in thenamedirectly?PHP 8.1+ adds support for using
modequery parameter when creating a connection. Wouldn't it be better to keep thenameor use the name specified inmemoryif nottrueas name for the database?https://github.com/cakephp/phinx/blob/master/src/Phinx/Db/Adapter/SQLiteAdapter.php#L159