Download the PHP package swiss-devjoy/laravel-optimize-sqlite without Composer
On this page you can find all versions of the php package swiss-devjoy/laravel-optimize-sqlite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download swiss-devjoy/laravel-optimize-sqlite
More information about swiss-devjoy/laravel-optimize-sqlite
Files in swiss-devjoy/laravel-optimize-sqlite
Package laravel-optimize-sqlite
Short Description Optimize your SQLite database for production in Laravel
License MIT
Homepage https://github.com/swiss-devjoy/laravel-optimize-sqlite
Informations about the package laravel-optimize-sqlite
Optimize your SQLite database for production in Laravel
This package is already used in production in multiple projects. Still, if you want to use this package, always backup your database before requiring it through Composer.
This package optimizes your SQLite database for production in Laravel. The settings are applied as soon as any sqlite database connection is established, so you can use them in your application right away.
The current settings are:
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
You can set general settings for all sqlite connections, and override them for specific connections. If you want to remove a general setting, just remove the config line from the config file. If you want to add a new setting, just add it to the config file.
Important notes
-
There is a known issue with databases already in WAL mode and running php artisan migrate:fresh which will throw an error, see https://github.com/laravel/framework/discussions/53044 My current alternative is to run a custom composer command (
composer.json
) which refreshes the whole app: - Laravel allows already to set some
PRAGMA
settings in config/database.php which will override the settings in this package. You might want to set those settings tonull
and use this config as sole single source of truth for sqlite database settings. - I noticed that running multiple PRAGMA statements in a single query (e.g.
PRAGMA journal_mode=WAL; PRAGMA auto_vacuum=incremental;
) does not work as expected. The settings are not applied. This is why I decided to run each setting in a separate query.
Inspiration
The general ideas are from Nuno Maduro's package https://github.com/nunomaduro/laravel-optimize-database. For more information about possible settings you can look into the SQLite documentation: https://www.sqlite.org/pragma.html
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Dimitri König
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-optimize-sqlite with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0