hasinhayder/tyro-checkpoint
Composer 安装命令:
composer require hasinhayder/tyro-checkpoint
包简介
Database checkpoint management for Laravel local development
README 文档
README
Database checkpoints for Laravel local development. Snapshot your database and restore it instantly. Supports SQLite, MySQL, and PostgreSQL.
Local development only. Not for production.
Requirements
- PHP 8.1+
- Laravel 10.x–13.x
- SQLite, MySQL 8+, or PostgreSQL 12+
- MySQL:
mysqldump,mysql - PostgreSQL:
pg_dump,psql
Install
composer require hasinhayder/tyro-checkpoint --dev php artisan tyro-checkpoint:install
Commands
| Command | Description |
|---|---|
tyro-checkpoint:create [name] [--encrypt] [--silent] |
Create a checkpoint |
tyro-checkpoint:list [id|name] |
List checkpoints (or view one) |
tyro-checkpoint:details [id|name] |
Show checkpoint details |
tyro-checkpoint:restore [id|name] |
Restore a checkpoint |
tyro-checkpoint:delete [id|name] |
Delete a checkpoint |
tyro-checkpoint:flush [--force] |
Delete all unlocked checkpoints |
tyro-checkpoint:lock [id|name] |
Lock (prevent deletion) |
tyro-checkpoint:unlock [id|name] |
Unlock |
tyro-checkpoint:flag [id|name] |
Flag for attention (🚩) |
tyro-checkpoint:unflag [id|name] |
Remove flag |
tyro-checkpoint:add-note [id|name] |
Add a note |
tyro-checkpoint:encrypt [id|name] |
Encrypt an existing checkpoint in place |
tyro-checkpoint:generate-key |
Generate encryption key into .env |
tyro-checkpoint:publish-config |
Publish config file |
tyro-checkpoint:install |
Run setup |
tyro-checkpoint:version |
Show version and system info |
Restore is non-destructive to checkpoints — you can restore the same one many times.
Auto-checkpoints
Snapshot automatically before risky commands (migrations, seeders, db:wipe).
TYRO_CHECKPOINT_AUTO_ENABLED=true
Default watched commands: migrate, migrate:fresh, migrate:refresh, migrate:reset, migrate:rollback, db:seed, db:wipe.
Configuration
Publish with tyro-checkpoint:publish-config. Defaults:
return [ 'storage_path' => storage_path('tyro-checkpoints'), 'encryption_key' => env('TYRO_CHECKPOINT_ENCRYPTION_KEY'), 'process' => [ 'timeout' => env('TYRO_CHECKPOINT_PROCESS_TIMEOUT', 600), ], 'auto_checkpoint' => [ 'enabled' => env('TYRO_CHECKPOINT_AUTO_ENABLED', false), 'commands' => ['migrate', 'migrate:fresh', 'migrate:refresh', 'migrate:reset', 'migrate:rollback', 'db:seed', 'db:wipe'], 'name_prefix' => env('TYRO_CHECKPOINT_AUTO_NAME_PREFIX', 'auto'), 'encrypt' => env('TYRO_CHECKPOINT_AUTO_ENCRYPT', false), 'stop_on_failure' => env('TYRO_CHECKPOINT_AUTO_STOP_ON_FAILURE', true), ], ];
Storage
storage/tyro-checkpoints/
├── checkpoints.json # Metadata (stored outside the DB)
├── name.sqlite # Snapshot files
└── ...
Metadata lives in checkpoints.json, so restoring a snapshot never loses track of other checkpoints.
Encryption
php artisan tyro-checkpoint:generate-key php artisan tyro-checkpoint:create secure --encrypt
Encrypted checkpoints auto-decrypt on restore. Back up TYRO_CHECKPOINT_ENCRYPTION_KEY — losing it makes encrypted checkpoints unrestorable.
Notes
- Full database snapshots (file copy for SQLite, SQL dump for MySQL/PostgreSQL).
- Locked checkpoints survive
flush. - In-memory SQLite (
:memory:) is not supported. - Delete unneeded checkpoints to save disk space.
License
MIT — © Hasin Hayder
hasinhayder/tyro-checkpoint 适用场景与选型建议
hasinhayder/tyro-checkpoint 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 131 次下载、GitHub Stars 达 71, 最近一次更新时间为 2026 年 02 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 hasinhayder/tyro-checkpoint 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hasinhayder/tyro-checkpoint 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 131
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 71
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-01