4 ms·
I really like the Django way where Python code is considered the ground truth. If your model changes in Python, migrations will automatically be generated to re
by sansnomme 7y ago
I really like the Django way where Python code is considered the ground truth. If your model changes in Python, migrations will automatically be generated to reflect the updated state.
AFAIK only TypeORM and really pricey enterprise database software comes with change management systems like this. Even Rails do not have such conveniences.
- conroy 7y agoAs you've probably noticed, sqlc is quite different than the Django model. If you're looking for something similar to the Django ORM but for Go, https://gorm.io/ https://gorm.io/ is probably your best bet.
- sansnomme 7y agoI am referring to migration management in general, not just ORM mapping. The majority of existing ORMs requires you to manually design up and down migrations which can be rather brittle and error-prone.
- hu3 7y agoMicrosoft's Entity Framework supports code as source of truth for at least a decade. They call it "Code First". https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/workflows/new-database https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/... The open source version Entity Framework Core also.