MigrationManager::GetInstance();
manager.CreateMigrationHistory();
size_t applied = manager.ApplyPendingMigrations();
```
Supports rollbacks, dry-run preview, checksum verification, and distributed locking for safe concurrent deployments.
---
## Backup & Restore
Full database backup/restore with progress reporting:
```cpp
#include <Lightweight/SqlBackup.hpp>
// Backup to compressed archive (multi-threaded)
SqlBackup::Backup(
"backup.zip",
connectionString,
4, // concurrent workers
progressManager,
"", // schema
"*", // table filter (glob)
{}, // retry settings
{ .method = CompressionMethod::Zstd, .level = 6 }
);
// Restore
SqlBackup::Restore("backup.zip", connectionString, 4, progressManager);
```
Preserves indexes, foreign keys (including composite), and supports table filtering.
---
## Supported Databases
- Microsoft SQL Server
- PostgreSQL
- SQLite3
Works anywhere ODBC works (Windows, Linux, macOS).
---
## What's Next
We're actively developing and would love feedback. The library is production-ready for our use cases, but we're always looking to improve the API and add features.
We also consider abstracting away ODBC such that it could support non-ODBC databases like SQLite3 directly without the ODBC layer. That's a longer-term goal, but definitely a goal.
We currently focus on SQL tooling (migrations and backup/restore) as both are quite young additions that are still evolving.
Questions and PRs welcome!
https://redd.it/1r0co80
@r_cpp
Post #24777
32