{"id":20408967,"url":"https://github.com/pavelvais/snapshot-doctrine","last_synced_at":"2026-05-11T09:42:53.287Z","repository":{"id":202974723,"uuid":"708279422","full_name":"PavelVais/snapshot-doctrine","owner":"PavelVais","description":"This library provides an easy way to take snapshots of your database using Doctrine ORM in PHP. It allows you to save and rollback snapshots, offering various storage options like clean JSON storage, compressed, and encrypted storage.","archived":false,"fork":false,"pushed_at":"2023-10-22T20:22:00.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-15T13:07:28.498Z","etag":null,"topics":["doctrine","orm","snapshot","symfony","testing","transaction"],"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/PavelVais.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-10-22T04:15:57.000Z","updated_at":"2023-10-22T20:25:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3270da3-efcc-44d3-942b-08b1ff5b3096","html_url":"https://github.com/PavelVais/snapshot-doctrine","commit_stats":null,"previous_names":["pavelvais/snapshot-doctrine"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelVais%2Fsnapshot-doctrine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelVais%2Fsnapshot-doctrine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelVais%2Fsnapshot-doctrine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelVais%2Fsnapshot-doctrine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PavelVais","download_url":"https://codeload.github.com/PavelVais/snapshot-doctrine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241955038,"owners_count":20048405,"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":["doctrine","orm","snapshot","symfony","testing","transaction"],"created_at":"2024-11-15T05:38:34.241Z","updated_at":"2026-05-11T09:42:53.234Z","avatar_url":"https://github.com/PavelVais.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snapshot Doctrine\n\nWIP: This library is still in development and not ready for production use.\n\n## Description\n\nThis library provides an easy way to take snapshots of your database using Doctrine ORM in PHP.\nIt allows you to save and rollback snapshots, offering various storage options like clean JSON storage, compressed, and encrypted storage.\n\n## Why to use this solution\n\n- **Efficiency**: Utilizes generators for handling large datasets without exhausting memory.\n- **Flexibility**: Provides multiple storage options, including JSON, compressed, and encrypted storage.\n- **Extensibility**: Easily extendable to support additional storage mechanisms.\n- **Simplicity**: No additional dependencies required. Easy to use and understand.\n- **Easy to Integrate**: Designed to work seamlessly with Doctrine ORM.\n\n### Scenarios\n\n#### Replacement for database transactions\n\nWhen some scripts takes a long time to run, it's impossible to run it in a single transaction. In this case, you can use this library to take a snapshot of the database before running the script. If the script fails, you can rollback the database to the snapshot.\n\n## Installation\n\n```bash\ncomposer require pavelvais/snapshot-doctrine\n```\n\n## Usage\n\n### Basic Usage\n\n```php\nuse Pavelvais\\SnapshotDoctrine\\Provider\\CommonSnapshotProvider;\n\n// Initialize with Doctrine's EntityManager\n$provider = new CommonSnapshotProvider($entityManager);\n$manager = new SnapshotManager('var/snapshots');\n\n// Take a snapshot\n$snapshot = $manager-\u003etakeSnapshot($provider);\n\n// Rollback to a snapshot\n$provider-\u003erollbackSnapshotData($snapshot);\n```\n\n### There are other storage options available\n\n### With JSON Storage\n### Compressed Storage\n```php\nuse Pavelvais\\SnapshotDoctrine\\Storage\\CompressedStorage;\n\n$storage = new CompressedStorage('/path/to/compressed/file.gz');\n```\n### Encrypted Storage\n```php\nuse Pavelvais\\SnapshotDoctrine\\Storage\\EncryptedStorage;\n\n$storage = new EncryptedStorage('/path/to/encrypted/file', 'your-encryption-key');\n```\n\n## Storage Implementations\n\nYou can extend this library by implementing your own storage solutions. Implement the `SnapshotStorageInterface` to get started.\n\n## Contributing\n\nPlease feel free to contribute by opening issues or creating pull requests.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavelvais%2Fsnapshot-doctrine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpavelvais%2Fsnapshot-doctrine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavelvais%2Fsnapshot-doctrine/lists"}