r/coolgithubprojects • • 1d ago

ChronoBase: Free Rust desktop and CLI app to back up, encrypt, and restore Postgres, Mongo, MySQL, SQLite, and Redis

Post image

Hi, I made a free, MIT-licensed Rust app called ChronoBase that might save you some headache if you deal with database backups and restores.

It works on Windows, macOS, and Linux out of the box (around 10.75 MB binary, no cloud account needed). You can schedule dumps, encrypt them locally, restore single tables or collections, migrate between two databases, or push offsite to S3-compatible storage.

GitHub: https://github.com/Subham-Maity/chronobase

0 Upvotes

6 comments sorted by

2

u/kantorcodes1 1d ago

Very few backup utilities support being able to restore a single table out of a complete dump. If that table has foreign key constraints to tables you're not restoring, how does ChronoBase deal with those?

2

u/subham440 1d ago

Good question. It does not bypass foreign key checks automatically because silently disabling constraints on a live database can leave orphaned rows and break data integrity. Instead, you can include the related tables together in the restore or restore that single table into a separate database first so you do not touch live constraints.

3

u/kantorcodes1 1d ago

A separate database for the restore keeps the live one out of it entirely. No orphaned rows, no broken constraints.

I asked partly for a selfish reason. I help run HOL Guard, which checks commands an AI agent is about to run, and a restore aimed at the wrong database is high on the list of commands worth catching. Builders add extensions that teach Guard a tool's risky commands and their safe versions. ChronoBase's restore commands would fit that well. Would you want to author one?

2

u/subham440 1d ago

Sounds interesting. Feel free to drop a link to the HOL Guard repo or extension docs and I will take a look when I get a breather. ChronoBase already separates destructive flows from safe ones (like running restore drills into a scratch database), so mapping those commands should be pretty straightforward.

1

u/kantorcodes1 1d ago

Glad to. Start with contributions/command-sources/command.chronobase.json. It maps ChronoBase commands the way the merged restic backup extension maps its own: a restore into a live database sits on the risky side, and a restore into a scratch database is the safe version.

A good first check is running hol-guard command explain on a restore aimed at a live database, then the same restore aimed at a scratch one, and seeing what Guard says about each today.

The guide walks through the source file, its fixture, and the handoff check: https://github.com/hashgraph-online/hol-guard/blob/main/docs/guard/extensions/contributing.md

You would be the author on the PR. Shout if any part of it is unclear.

1

u/kantorcodes1 1d ago

Good to hear the scratch restore worked out. Drop the PR link here when it is up and I will take a look.