5 ms·
Sorry to butt heads there, but what ORM does automatically handle schema changes? I have so many teams with highly abstracted ORMs telling me that no-downtime s
by tetha 4y ago
Sorry to butt heads there, but what ORM does automatically handle schema changes? I have so many teams with highly abstracted ORMs telling me that no-downtime schema changes are impossible, no matter how trivial the changes are, or would be in e.g. Hibernate.
And the only team capable of zero-downtime schema changes uses a minimal DSL to SQL lib.
- ipaddr 4y agoThis problem seems foreign to me. Are your teaming not using Laravel? If not maybe it's time to upgrade. https://laravel.com/docs/10.x/eloquent https://laravel.com/docs/10.x/eloquent
- akprasad 4y agoI don't know of any ORM that handles schema changes automatically (edit: for the most strict definition of "automatically" -- I've used ORMs that generate migration files and am generally happy with them). My experience here is quite limited, so I'm inclined to defer to yours. With that caveat, I find that ORMs play more nicely with my IDE (e.g. I can rename a column name and automatically update all call sites) and often raise early warnings if their declarative classes are out of sync with the underlying table schema.
- travisjungroth 4y agoThere are two parts to the schema change, the table changes (migrations) and the code changes. I think the person you were replying to was asking about the code part. Every ORM I've used or looked at[0] does that automatically in the sense that you make a change to a model and all queries generated by that model will now have that change. Depending on the change they could break, but the point is the changes propagate. If you're not using an ORM and are just using string templates, this won't happen. There are query builders, too, which are sort of in between. [0] Django, SQLAlchemy, Active Record, Piccolo, Tortoise, SQLModel, peewee
- akprasad 4y ago^yes, that's indeed what I had in mind, and you've articulated the position very clearly.
- travisjungroth 4y agoThanks, I’m glad! It’s a topic that pops up for me a lot. Related: https://news.ycombinator.com/item?id=26905647 https://news.ycombinator.com/item?id=26905647
- yakshaving_jgt 4y agoThe persistent[0] library can automatically generate and run migrations to match schema changes. [0]: https://hackage.haskell.org/package/persistent-2.14.5.0/docs/Database-Persist.html https://hackage.haskell.org/package/persistent-2.14.5.0/docs...