From 0d272ed0d951da4157b0d8baf8bef3e12bb413fa Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Tue, 12 Nov 2024 18:21:25 +0000 Subject: [PATCH] Enable WAL mode in SQLite --- src/NativeServiceProvider.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/NativeServiceProvider.php b/src/NativeServiceProvider.php index f6eb5b3..f966db7 100644 --- a/src/NativeServiceProvider.php +++ b/src/NativeServiceProvider.php @@ -4,6 +4,7 @@ use Illuminate\Console\Application as Artisan; use Illuminate\Support\Arr; +use Illuminate\Support\Facades\DB; use Native\Laravel\Commands\FreshCommand; use Native\Laravel\Commands\LoadPHPConfigurationCommand; use Native\Laravel\Commands\LoadStartupConfigurationCommand; @@ -122,6 +123,9 @@ public function rewriteDatabase() ]]); config(['database.default' => 'nativephp']); + + DB::statement('PRAGMA journal_mode=WAL;'); + DB::statement('PRAGMA busy_timeout=5000;'); } public function removeDatabase()