Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
karlomikus committed Dec 9, 2024
1 parent dbc0b04 commit 3e942c3
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Kami\Cocktail\Providers;

use Throwable;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
Expand All @@ -24,10 +26,16 @@ public function register()
*/
public function boot()
{
DB::statement('
PRAGMA temp_store = memory;
PRAGMA cache_size = -20000;
PRAGMA mmap_size = 2147483648;
');
if (DB::getDriverName() === 'sqlite') {
try {
DB::statement('
PRAGMA temp_store = memory;
PRAGMA cache_size = -20000;
PRAGMA mmap_size = 2147483648;
');
} catch (Throwable $e) {
Log::warning('Unable to connect to DB setup PRAGMAs');
}
}
}
}

0 comments on commit 3e942c3

Please sign in to comment.