4 ms·
The reason for me to use ORM rather than direct SQL queries is so I can keep everything written in a single language, so I can develop with one IDE. Having ever
by Asooka 9y ago
The reason for me to use ORM rather than direct SQL queries is so I can keep everything written in a single language, so I can develop with one IDE. Having everything under one roof is a huge boon to productivity, rather than having to edit the logic in the IDE, then edit the database queries in a different editor, and the two knowing nothing about each other. It lets me directly map my source language's type system to the database's schema, avoiding discrepancies.
- paulddraper 9y agoI can sympathize. For me, that's Scala JVM on the server, ScalaTags/ScalaCSS/ScalaJS in the web browser, Slick for the ORM, and SBT for the build system. The bliss of learn once, program anywhere. When this hits reality though, I use Relate https://github.com/lucidsoftware/relate https://github.com/lucidsoftware/relate (disclaimer: I'm a contributor) It's SQL, but with minimal syntactic overhead. sql"SELECT * FROM users WHERE email IN ($emails)".asList[User]()
- Nullabillity 9y agoSince you're already using Slick, what's the difference between Relate and Slick's native SQL literals[1]? [1]: http://slick.lightbend.com/doc/3.2.0/sql.html http://slick.lightbend.com/doc/3.2.0/sql.html
- paulddraper 9y agoOr Anorm [1] for that matter. They're all pretty similar in the idea of typed Scala string interpolation. [1]: https://www.playframework.com/documentation/2.5.x/ScalaAnorm#sql-queries-using-string-interpolation https://www.playframework.com/documentation/2.5.x/ScalaAnorm...
- wvenable 9y agoDon't most IDE's do SQL in the mix with everything else or am I just spoiled by Visual Studio? My opinion is that one uses an ORM for different situations than they would use SQL. Many applications can use an ORM and nothing else. Some can use an ORM for basic CRUD tasks and then raw SQL to do analysis or reporting.
- gfody 9y agoyou (and I) are absolutely spoiled by Visual Studio w/SSDT. there is nothing even remotely close to that level of integration for database development in other stacks.
- justinclift 9y agoErr... any of the JetBrains IDE's? They have database integration. It's also available standalone as "DataGrip", though I've never used it: https://www.jetbrains.com/datagrip/ https://www.jetbrains.com/datagrip/
- gfody 9y agothe level of integration with SSDT is way beyond that - the database structure and stored procs live side-by-side with your code, are source controlled together, built and deployed together. there's compile-time checks for stored procedures, code analysis, etc. DataGrip is just an alternative for SQL Developer/Management Studio, SSDT is much more.