Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4b80025

Browse filesBrowse files
authored
[9.x] Add support for named in-memory SQLite connections (#271)
* [9.x] Add support for named in-memory SQLite connections PR: laravel/framework#53635 Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com> * wip Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com> --------- Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
1 parent ff10821 commit 4b80025
Copy full SHA for 4b80025

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed

‎src/Concerns/HandlesDatabases.php

Copy file name to clipboardExpand all lines: src/Concerns/HandlesDatabases.php
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,13 @@ protected function usesSqliteInMemoryDatabaseConnection(?string $connection = nu
9191
/** @var array{driver: string, database: string}|null $database */
9292
$database = $config->get("database.connections.{$connection}");
9393

94-
return ! \is_null($database) && $database['driver'] === 'sqlite' && $database['database'] == ':memory:';
94+
if (\is_null($database) || $database['driver'] !== 'sqlite') {
95+
return false;
96+
}
97+
98+
return $database['database'] == ':memory:'
99+
|| str_contains($database['database'], '?mode=memory')
100+
|| str_contains($database['database'], '&mode=memory');
95101
}
96102

97103
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.