Re:The ORM Debate Still Rages On
by paulddraper on Monday April 24, 2017 @04:18PM
(#14187866)
> 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), 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.
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.