Download the PHP package loadinglucian/laravel-optimal-sqlite without Composer

On this page you can find all versions of the php package loadinglucian/laravel-optimal-sqlite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-optimal-sqlite

Laravel Optimal SQLite

Introduction

SQLite is a great fit for many Laravel applications, but its best production settings need to be applied at the right time. Some settings belong to each connection, while others affect the database file itself and must be applied before Laravel creates schema tables.

Laravel Optimal SQLite gives your Laravel application production-oriented SQLite defaults without adding a custom command to remember. When you run Laravel's normal migration commands, the package prepares empty SQLite database files before the migrations table is created. At runtime, it applies sensible SQLite connection defaults to every configured SQLite connection.

This package was inspired by Nuno Maduro's nunomaduro/laravel-optimize-database. That package showed how useful a small SQLite optimization layer can be for Laravel. Laravel Optimal SQLite takes the idea further by handling the lifecycle issues around page_size, WAL mode, VACUUM, and migrate:fresh.

Requirements

Laravel Optimal SQLite requires a Laravel application using a file-backed SQLite connection. Runtime connection defaults may be applied to any SQLite connection, but file-level settings such as page_size and auto_vacuum cannot be applied to :memory: databases.

Laravel package discovery should be enabled so the service provider can register automatically. If your application disables package discovery, manually register the provider:

After installing the package, run your normal Laravel migrations. The package optimizes empty SQLite database files during php artisan migrate and preserves those file settings during php artisan migrate:fresh.

Installation

You may install the package with Composer:

Laravel will discover the service provider automatically.

After installation, continue using Laravel's standard migration commands:

You do not need to run a package-specific optimization command.

What It Does

The package applies two kinds of SQLite settings.

Runtime connection settings are applied to every configured SQLite connection before Laravel opens it:

File-level settings are applied automatically before migrations create tables:

This sequence matters. SQLite can only apply page_size at database creation or during VACUUM while the database is not in WAL mode. The package temporarily leaves WAL mode, applies the file settings, vacuums the empty database file, and then restores WAL mode.

The package also replaces Laravel's SQLite db:wipe behavior for file-backed SQLite databases. Laravel normally empties the SQLite file during db:wipe, which resets file-level settings such as page_size. Laravel Optimal SQLite drops schema objects instead, so repeated migrate:fresh runs keep the optimized file format intact.

How This Differs From Nuno's Package

Nuno's package provided the useful starting point: codify a production-ready SQLite profile for Laravel. Laravel Optimal SQLite keeps that spirit, but it changes the delivery mechanism.

This package does not publish a migration stub. Laravel creates the migrations table before running the first migration, so a "first" migration is still too late for some SQLite file settings unless it performs a careful VACUUM flow. Instead, this package hooks into Laravel's normal migrate command and applies file-level settings before the migrations table exists.

This package also avoids an extra Artisan command in your day-to-day workflow. You continue running php artisan migrate and php artisan migrate:fresh.

Finally, this package tests the observed SQLite values after tuning. The test suite verifies the real PRAGMA values, including page_size, auto_vacuum, WAL mode, runtime connection settings, and repeated migrate:fresh behavior.

Configuration

By default, every configured SQLite connection receives the package defaults. You may override runtime settings directly in your config/database.php connection array:

The file-level defaults are intentionally not exposed through environment variables. They affect the database file format and should remain stable across environments.

Existing Databases

The automatic migration flow only optimizes SQLite files that do not yet have user-created tables. Existing populated databases are skipped so the package does not unexpectedly rewrite a production database file.

Before applying file-level changes to an existing SQLite database, take a backup. Then perform the maintenance explicitly in your own deployment process or call the SQLiteDatabaseOptimizer service from a controlled script.

Testing

You may run the package test suite with Composer:

The tests use real temporary SQLite files and assert the actual post-tuning PRAGMA values.

License

Laravel Optimal SQLite is open-sourced software licensed under the MIT license.


All versions of laravel-optimal-sqlite with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/filesystem Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package loadinglucian/laravel-optimal-sqlite contains the following files

Loading the files please wait ...