v0.10.0 is released! #191
GeekMasher
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm happy to announce that GeekORM v0.10.0 has been released.
This update has quite a lot of breaking changes that hopefully will improve the support in the long run for GeekORM.
Migration Changes [breaking changes]
A concerning issue I observed during the development of some of my projects using
geekorm = "0.9"was two things:Database,Table, andColumnstructs in the Rust codeRust struct code changes
The first issue was in regards to a new feature I added called
multi-databases#184 which show cased an issue with theTablestruct where some models in a single code base could be for different databases. An example of this was thegrypedbsupport in my Konarr project where the models here are not present (and shouldn't be) in the main database.This means that when I changes the
Tablestruct to have an optionaldatabase namefield, all my previously generated Rust code was incorrect (and rightfully so). I needed to re-generate all the different model versions with the changes which was difficult without a snapshot of the database at the time of generation.This can be seen here:
Support for multi-database backends
A feature I've wanted to bring to GeekORM is the ability to have multiple database backend support such as Postgres #173 and others but this came with a challenge after the launch of
v0.9.Generating a
create.sqlormigration.sqlwould only work for a single database, not for multiple.The Solution... JSON!
The solution I decided on was to always generate JSON files for both database in time snapshots and the changes / migrations that need to be performed.
The
database.jsonis a file with all the details for all of the databases in a project. This includes those "other" databases I spoke about. Maybe in the future I can create migrations for those too.The
migrations.jsonstores the migrations the user told GeekORM to do in a simple format that in theory can been changed / updated manually after the fact.Ironically after implementing this feature I went to see how the
sqlxteam does / handles this and they use JSON files to solve exactly this issue.geekorm-cli updatechanges [feature]Now with the new migration feature the
geekorm-cli updatecommand will automatically update all of the Rust code automatically for you.Conclusions
This will be a pain for those who have tried out
v0.9and started rolling this out but I think this breaking change will help the project in the long run and its worth doing this now versus when 100s or 1,000s of projects are using GeekORM.Please share feedback, bugs, or issues in the GitHub Issues or comments.
Beta Was this translation helpful? Give feedback.
All reactions