PHPackages                             eznix86/laravel-sqlite - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. eznix86/laravel-sqlite

ActiveLibrary[Database &amp; ORM](/categories/database)

eznix86/laravel-sqlite
======================

Optimize SQLite for Laravel

v2.0.0(2mo ago)53[1 issues](https://github.com/eznix86/laravel-sqlite/issues)MITPHPPHP ^8.3CI passing

Since Feb 20Pushed 2mo agoCompare

[ Source](https://github.com/eznix86/laravel-sqlite)[ Packagist](https://packagist.org/packages/eznix86/laravel-sqlite)[ RSS](/packages/eznix86-laravel-sqlite/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (18)Versions (6)Used By (0)

Optimize SQLite For Laravel
===========================

[](#optimize-sqlite-for-laravel)

[![Optimize SQLite Banner](./art/optimize-sqlite.png)](./art/optimize-sqlite.png)

Optimize SQLite for Laravel in production.

This package exists to give SQLite-first Laravel apps explicit control over performance PRAGMAs, maintenance commands, and migration-time file behavior.

Features
--------

[](#features)

- Multi SQLite Connection Support
- Configurable SQLite PRAGMAs
- Supports [Litestream Package](#litestream-support)
- Handles migration command startup to prepare missing SQLite files/directories.

Requirements
------------

[](#requirements)

- PHP `^8.4`
- Laravel `12.x` (package is built/tested against the Laravel 12 ecosystem)

Installation
------------

[](#installation)

```
composer require eznix86/laravel-sqlite
```

Publish the config file:

```
php artisan vendor:publish --tag=sqlite-config
```

Configuration
-------------

[](#configuration)

Configuration lives in `config/sqlite.php`.

Key options:

- `sqlite.enabled` - enable/disable package PRAGMA application.
- `sqlite.litestream` - Litestream-safe mode (forces `wal_autocheckpoint=0`).
- `sqlite.pragmas.incremental_vacuum`
- `sqlite.pragmas.temp_store`
- `sqlite.pragmas.cache_size_mb`
- `sqlite.pragmas.mmap_size_mb`
- `sqlite.pragmas.wal_autocheckpoint`

Environment variable prefix: `SQLITE_...`

Commands
--------

[](#commands)

### Vacuum

[](#vacuum)

Run full `VACUUM` on SQLite connections:

```
php artisan sqlite:vacuum
php artisan sqlite:vacuum --connection=sqlite
```

Notes:

- Without `--connection`, it runs on all configured SQLite connections.
- If `sqlite.litestream=true`, the command is blocked by design.

### Show PRAGMAs

[](#show-pragmas)

Display configuration and runtime PRAGMA values:

```
php artisan sqlite:show-pragmas
php artisan sqlite:show-pragmas sqlite
```

### Manually Cache / Clear PRAGMA SQL

[](#manually-cache--clear-pragma-sql)

```
php artisan sqlite:cache-pragmas
php artisan sqlite:clear-pragmas-cache
```

These are also connected to Laravel optimize commands:

- `php artisan optimize` -&gt; caches PRAGMA SQL
- `php artisan optimize:clear` -&gt; clears PRAGMA SQL cache

Migration Behavior
------------------

[](#migration-behavior)

The package listens for commands and prepares SQLite file connections automatically:

- For `migrate*` and `db:wipe`: ensures database files/directories exist (except `:memory:`).
- For `migrate:fresh`: removes the SQLite file and sidecars (`-wal`, `-shm`, `-journal`) first, then recreates the database file.
- If `--database=...` is provided, only that SQLite connection is targeted.

Litestream Support
------------------

[](#litestream-support)

If you want to back up and replicate your SQLite database with Litestream. Use [`eznix86/laravel-litestream`](https://github.com/eznix86/laravel-litestream):

- GitHub:
- Packagist:

Development
-----------

[](#development)

```
composer test:types
composer refactor
composer lint
composer lint:fix
composer test
```

Notes:

- This package currently uses feature-style tests; there is no dedicated `test:unit` script.

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance82

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Total

3

Last Release

61d ago

Major Versions

v0.1.0 → v1.0.02026-02-20

v1.0.0 → v2.0.02026-03-18

PHP version history (2 changes)v0.1.0PHP ^8.4

v2.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/f52290ecebdd960ddfacf23d664e78b03c13f81fba7fbba661161b050f6a4150?d=identicon)[eznix86](/maintainers/eznix86)

---

Top Contributors

[![eznix86](https://avatars.githubusercontent.com/u/26553194?v=4)](https://github.com/eznix86 "eznix86 (9 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (2 commits)")

---

Tags

laraveloptimizeproductionsqlite

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/eznix86-laravel-sqlite/health.svg)

```
[![Health](https://phpackages.com/badges/eznix86-laravel-sqlite/health.svg)](https://phpackages.com/packages/eznix86-laravel-sqlite)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
