|
|
|
|
|
by c120
1042 days ago
|
|
So far all my projects have targeted a specific database with no reason to change it. So what I do is write SQL commands, but keep all inside a specific file or module of the project. So that I can decide later to refactor it into an ORM. I think ORMs are great if you write libraries that target more than one database. Or situations, where you have more than one database and need a proper migration part. If you don't need migration, but in the worst case can start with a fresh, empty database, then write SQL. But for production system, the no/manual migration might get old quickly. Writing migration code that just adds fields, indexes or tables is easy. But
writing code that changes fields or table structures? Not do much. Still, you don't need an ORM at the beginning of a project, just don't put SQL everywhere. |
|