Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use Gorm.io instead of soda/pop #275

Closed
wants to merge 3 commits into from

Conversation

jrapoport
Copy link

@jrapoport jrapoport commented Dec 18, 2020

- Summary
Drop soda/pop in favor of gorm.io. gorm is easier to use and maintain. changing a model now involves adding the field to the struct, and that's it. It will automatically migrate changes based on the struct itself, and is now completely self-contained — meaning no more migration path or sql files. On Dial() it will now automatically create the DB (if needed)and set everything up/migrate any changes. More complex migrations (i.e. moving data) would require code, but that is supported by gorm and easy enough to add. This also adds support for sqlserver, postgres, and sqlite. There are also a number of other gorm drivers available for things like AWS.

- Test plan

passing

- Description for the changelog

removes soda/pop & related files in favor of gorm.io. db setup & migration is now automatic and self-contained.

- A picture of a cute animal (not mandatory but encouraged)
happy-pupper

@jrapoport jrapoport requested review from a team as code owners December 18, 2020 06:10
@jrapoport jrapoport changed the title Gorm use Gorm.io instead of soda/pop Dec 18, 2020
@jrapoport jrapoport changed the title use Gorm.io instead of soda/pop feat: use Gorm.io instead of soda/pop Dec 18, 2020
@jrapoport
Copy link
Author

idk what is up with the label failing. I added "feat:" 🤷🏻‍♂️

@mraerino mraerino added the type: chore work needed to keep the product and development running smoothly label Dec 18, 2020
@mraerino
Copy link
Member

@jrapoport thanks for your contribution.

it's very unlikely that we'll switch this service to use gorm.
we use pop or sqlx in most systems at netlify today and don't feel confident enough for production use of gorm.

the main reason is that we have a strong preference towards explicit migrations that are applied manually.
it's hard to recover our production systems from a failed migration.
at some point we might have better tooling to address this concern, but for now, this is a limit we'll keep.

@jrapoport
Copy link
Author

I'm dropping a link here for anyone that finds this and wants to use it: https://github.com/jrapoport/gothic

it started off as a PR/ fork, but has since been completely rewritten.

@jrapoport jrapoport closed this Jul 6, 2021
@jrapoport jrapoport deleted the gorm branch July 6, 2021 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants