esplora/spire

Easy Tools for Production Environment of Laravel SQLite Database
3,000 2
Install
composer require esplora/spire
Latest Version:0.0.4
PHP:^8.0
License:MIT
Last Updated:Mar 2, 2026
Links: GitHub  ·  Packagist
Maintainer: tabuna

Spire

Spire is a Laravel package designed to provide easy tools specifically tailored for optimizing SQLite databases in production environments.

Installation

To install Spire into your Laravel project, you can use Composer:

composer require esplora/spire

Usage

Once installed, you can utilize Spire's commands via the Artisan CLI.

Commands

Enable WAL Journal

To enable WAL journal on SQLite databases for performance optimization:

php artisan sqlite:wal-enable

Enabling WAL journaling can enhance database concurrency, reduce contention, and improve overall database performance, especially in high-traffic production environments.

Optimize Database

To optimize the SQLite database by running PRAGMA optimize:

php artisan sqlite:optimize

This combined optimization process ensures comprehensive optimization of the database file, resulting in improved performance and efficient storage utilization.

Run VACUUM

To optimize the SQLite database by running VACUUM:

php artisan sqlite:vacuum

VACUUM rebuilds the database file, reclaims unused disk space, and can help to improve database performance by optimizing storage utilization.

Schedule

For efficient database maintenance, it's highly recommended to schedule some of these commands as cron jobs. For instance, you can optimize the SQLite database periodically by adding a cron job to your scheduler:

// Optimize SQLite database every minute,
// see https://www.sqlite.org/pragma.html#pragma_optimize
$schedule->command('sqlite:optimize')->everyMinute();

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

391,429,217 4,660