10 ms·
You are absolutely right. Besides this, I see two main advantages to ORMs. 1. They isolate the "magic strings" where your code knows about your database schema
by NoGravitas 10y ago
You are absolutely right. Besides this, I see two main advantages to ORMs.
1. They isolate the "magic strings" where your code knows about your database schema in one place (the mappings or conventions). Database changes break your app in only one predictable place.
2. They keep junior developers from constructing queries in ways that are vulnerable to SQL injections.
- paulddraper 10y ago> vulnerable to SQL injections I put part of that blame on languages. When the wrong thing is so much more natural than the right thing, it's bound to happen. We use relate (https://github.com/lucidsoftware/relate https://github.com/lucidsoftware/relate), a Scala lib. sql"SELECT * FROM users WHERE email = $email" After years and years of no ORM and dozens of junior developers, we've never had a SQL injection bug.