Skip to content
้กน็›ฎ

ๅ…ณไบŽ

๐Ÿ’จ Provides a good starting point for production-ready SQLite databases

ๆ•ฐๆฎไธŽๅˆ†ๆž

่ฟ™ไบ›ๆ•ฐๅญ—ๅฆ‚ไฝ•็ปŸ่ฎก

ๅฎžๆต‹ๆ˜Ÿๆ ‡ๅขž้•ฟ

24ๅฐๆ—ถ
0
7ๅคฉ
0
15ๅคฉ
-1
1ไธชๆœˆ
ๆญฃๅœจๆ”ถ้›†ๅކๅฒ

ๅ„ๅ‘จๆœŸๅ†…็š„ๆ˜Ÿๆ ‡ๅ‡€ๅ˜ๅŒ–๏ผŒๅ‘จๆœŸ็›ธไบ’้‡ๅ ๏ผŒๅนถ้žๆฏๆ—ฅๆ–ฐๅขžใ€‚็ผบๅคฑ็š„ๆต‹้‡ไฟๆŒ็ฉบ็™ฝใ€‚ๆ˜Ÿๆ ‡ไปฃ่กจๅ…ณๆณจๅบฆ๏ผŒไธไปฃ่กจ่ฝฏไปถ่ดจ้‡ใ€‚

README.md

ๅŽŸๆ–‡

Skeleton Php

GitHub Workflow Status (main) Total Downloads Latest Version License YouTube Channel Subscribers


This package is a work-in-progress, therefore you should not use it in production - and always backup your database before requiring it through Composer.

This package provides a simple way to optimize your SQLite database in Laravel; it's a good starting point for production-ready SQLite databases. At the time of this writing, it applies the following settings:

 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚ Setting                   โ”‚ Value       โ”‚ Via       โ”‚
 โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
 โ”‚ PRAGMA auto_vacuum        โ”‚ incremental โ”‚ Migration โ”‚
 โ”‚ PRAGMA journal_mode       โ”‚ WAL         โ”‚ Migration โ”‚
 โ”‚ PRAGMA page_size          โ”‚ 32768       โ”‚ Migration โ”‚
 โ”‚ PRAGMA busy_timeout       โ”‚ 5000        โ”‚ Runtime   โ”‚
 โ”‚ PRAGMA cache_size         โ”‚ -20000      โ”‚ Runtime   โ”‚
 โ”‚ PRAGMA foreign_keys       โ”‚ ON          โ”‚ Runtime   โ”‚
 โ”‚ PRAGMA incremental_vacuum โ”‚ (enabled)   โ”‚ Runtime   โ”‚
 โ”‚ PRAGMA mmap_size          โ”‚ 2147483648  โ”‚ Runtime   โ”‚
 โ”‚ PRAGMA temp_store         โ”‚ MEMORY      โ”‚ Runtime   โ”‚
 โ”‚ PRAGMA synchronous        โ”‚ NORMAL      โ”‚ Runtime   โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The settings are applied in two ways:

๐Ÿš€ Installation

Requires PHP 8.2+, SQLite 3.46+ and Laravel 11.0+

You can install the package via Composer:

composer require nunomaduro/laravel-optimize-database

๐Ÿ™Œ Usage

To get started optimizing your SQLite database, you need to run the following command:

php artisan db:optimize

At this point, the [Runtime] settings are applied automatically. However, you need to run the migration to apply the [Migration] settings:

php artisan migrate

Laravel Optimize Database was created by Nuno Maduro under the MIT license.

ๆŽข็ดข็›ธๅ…ณ้กน็›ฎ

ๅŠ ่ฝฝไธญโ€ฆ