Odonno / surrealdb-migrations

An awesome SurrealDB migration tool, with a user-friendly CLI and a versatile Rust library that enables seamless integration into any project.
https://crates.io/crates/surrealdb-migrations
MIT License
210 stars 16 forks source link

Pull, push and diff data from/to remote and other databases (Dolt/Dolthub like) #47

Open lucasfcnunes opened 1 year ago

lucasfcnunes commented 1 year ago

Describe the solution you'd like Data versioning.

Describe alternatives you've considered "Dolt is a SQL database that you can fork, clone, branch, merge, push and pull just like a Git repository." https://github.com/dolthub/dolt e.g. https://www.dolthub.com/repositories/dolthub/transparency-in-pricing/compare/main/q2qstgacg1qa5lt8ensr4lschldirjh4

Odonno commented 1 year ago

Hi Lucas,

From what I understand Dolt is pretty much Database Branching feature? If this is truly that, please note that Database Branching is currently a feature in progress. You can read some of the early work here: https://github.com/Odonno/surrealdb-migrations#database-branching

The idea is to be able to work with branches locally, for your development workflow. Or even with a production database, giving you full control over data management. However, I will only provide the cli commands for that. Dolt seems to offer a Dolthub interface which will be out of scope for this project.

lucasfcnunes commented 1 year ago

I didn't expect a UI (but I do think it's pretty neat) but CLI data push, pull and diff would be really cool.

gedw99 commented 7 months ago

This sounds like a great feature. Really well designed workflow for developers.

One concept that can work well with this is that the migration files are created as a result of the db schema being changed via another system such as a gui. This is how pocketbase works against SQLite. It’s really a CMS in that users or devs can create and delete data types via a web gui . The web gui reflects on the DB to display the GUI that represents the DB. So you sort of have a web gui to the DB like pgadmin, but with automatic Schema migration files being created at the same time.