feat: sqlite in memory db
This commit is contained in:
parent
d692538163
commit
f599a68529
1 changed files with 4 additions and 2 deletions
|
|
@ -57,8 +57,10 @@ class Database extends PDO
|
|||
if (isset($dsn['schema'])) {
|
||||
$connection->query('SET search_path TO ' . $dsn['schema']);
|
||||
}
|
||||
}
|
||||
if ($dsn['phptype'] == 'sqlite') {
|
||||
} elseif ($dsn['phptype'] == 'sqlite::memory') {
|
||||
$connection = new self("{$dsn['phptype']}:");
|
||||
$connection->sqliteCreateFunction('LOWER', 'sqliteLower', 1);
|
||||
} elseif ($dsn['phptype'] == 'sqlite') {
|
||||
$connection/*: Database*/ = new self("{$dsn['phptype']}:{$dsn['database']}");
|
||||
$connection->setAttribute(PDO::ATTR_TIMEOUT, 5);
|
||||
$mode = defined('SQLITE_JOURNAL_MODE') ? SQLITE_JOURNAL_MODE : 'WAL';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue