{"id":17965993,"url":"https://github.com/joeymckenzie/sqlighter","last_synced_at":"2025-08-16T13:31:33.584Z","repository":{"id":259774930,"uuid":"879330778","full_name":"JoeyMckenzie/sqlighter","owner":"JoeyMckenzie","description":"A Laravel package for routinely backing up your SQLite database.","archived":false,"fork":false,"pushed_at":"2024-10-27T22:34:20.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-28T00:13:36.249Z","etag":null,"topics":["laravel","php","sqlite"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoeyMckenzie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-27T16:17:20.000Z","updated_at":"2024-10-27T22:34:24.000Z","dependencies_parsed_at":"2024-10-28T00:13:39.332Z","dependency_job_id":"0d0930b5-c08f-4708-bc38-49961827859c","html_url":"https://github.com/JoeyMckenzie/sqlighter","commit_stats":null,"previous_names":["joeymckenzie/sqlighter"],"tags_count":0,"template":false,"template_full_name":"spatie/package-skeleton-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeyMckenzie%2Fsqlighter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeyMckenzie%2Fsqlighter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeyMckenzie%2Fsqlighter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeyMckenzie%2Fsqlighter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoeyMckenzie","download_url":"https://codeload.github.com/JoeyMckenzie/sqlighter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222052294,"owners_count":16922713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","php","sqlite"],"created_at":"2024-10-29T13:06:27.489Z","updated_at":"2024-10-29T13:06:36.847Z","avatar_url":"https://github.com/JoeyMckenzie.png","language":"PHP","readme":"# SQLighter: Backup Commands for your SQLite Databases\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/joeymckenzie/sqlighter.svg?style=flat-square)](https://packagist.org/packages/joeymckenzie/sqlighter)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/joeymckenzie/sqlighter/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/joeymckenzie/sqlighter/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/joeymckenzie/sqlighter/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/joeymckenzie/sqlighter/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/joeymckenzie/sqlighter.svg?style=flat-square)](https://packagist.org/packages/joeymckenzie/sqlighter)\n\nSQLighter is a lightweight SQLite backup solution for Laravel applications. SQLighter provides automated backups of your\nSQLite database with configurable retention policies, while allowing for manual backups through an artisan command.\n\n- 🔄 Automated SQLite database backups\n- ⚙️ Configurable backup frequency\n- 📦 Backup file rotation with configurable retention\n- 🗂️ Automatic backup directory creation\n- 🚫 Git-friendly (auto-generates appropriate .gitignore)\n- 💡 Simple integration with Laravel's scheduler\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require joeymckenzie/sqlighter\n```\n\n## Usage\n\nAfter installation, publish the configuration file:\n\n```bash\nphp artisan vendor:publish --tag=\"sqligther-config\"\n```\n\nThis will create a `config/sqligther.php` configuration file. Customize the options to fit your needs:\n\n```php\nreturn [\n    // Enable/disable automatic backups\n    'enabled' =\u003e env('SQLIGHTER_ENABLED', true),\n\n    // Hours between backups\n    'frequency' =\u003e env('SQLIGHTER_FREQUENCY', 3),\n\n    // SQLite database filename\n    'database' =\u003e env('SQLIGHTER_DATABASE', 'database.sqlite'),\n\n    // How many backup copies to maintain\n    'copies_to_maintain' =\u003e env('SQLIGHTER_COPIES', 5),\n\n    // Where to store backups (relative to database directory)\n    'storage_folder' =\u003e env('SQLIGHTER_STORAGE', 'backups/'),\n\n    // Prefix for backup files\n    'file_prefix' =\u003e env('SQLIGHTER_PREFIX', 'backup'),\n];\n```\n\n### Automatic Backups\n\nSQLighter automatically registers a scheduled command to perform backups based on your configuration. No additional\nsetup is required other than ensuring your Laravel scheduler is running:\n\n```bash\ncd /path-to-your-project \u0026\u0026 php artisan schedule:run \u003e\u003e /dev/null 2\u003e\u00261\n```\n\nBackups are configured to run every six hours by default, though can be overridden using the `sqlighter.frequency`\nconfiguration option. Any valid cron string will work:\n\n```php\nreturn [\n    // Using hour intervals\n    'frequency' =\u003e 1,    // Every hour\n    'frequency' =\u003e 12,   // Every 12 hours\n    'frequency' =\u003e 24,   // Daily\n    'frequency' =\u003e 168,  // Weekly\n\n    // Or using cron expressions\n    'frequency' =\u003e '0 * * * *',     // Every hour\n    'frequency' =\u003e '0 */12 * * *',  // Every 12 hours\n    'frequency' =\u003e '0 0 * * *',     // Daily at midnight\n    'frequency' =\u003e '0 0 * * 0',     // Weekly on Sunday at midnight\n    'frequency' =\u003e '30 2 * * *',    // Daily at 2:30 AM\n];\n```\n\n### Manual Backups\n\nYou can also trigger a backup manually using the provided Artisan command:\n\n```bash\nphp artisan sqlighter:backup\n```\n\n### Backup Storage\n\nBackups are stored in your Laravel database directory under the configured `storage_folder` (default: `backups/`). A\n`.gitignore` file is automatically created to prevent backups from being committed to your repository.\n\n### File Naming\n\nBackup files are named using the following format:\n\n```\n{prefix}-{timestamp}.sql\n```\n\nFor example: `backup-1698765432.sql`\n\n## Testing\n\nPest is used to test the backup command. To run tests, just use the composer script:\n\n```bash\ncomposer test\n```\n\n## Security Vulnerabilities\n\nIf you discover a security vulnerability within SQLighter, please send an e-mail to Joey McKenzie\nvia [joey.mckenzie27@gmail.com](mailto:joey.mckenzie27@gmail.com).\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeymckenzie%2Fsqlighter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeymckenzie%2Fsqlighter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeymckenzie%2Fsqlighter/lists"}