Re:Myth: Select * is Bad
by bcoates on Sunday August 25, 2013 @04:38PM
(#6273620)
The ORM I really want just takes my SQL and a connection to my database at compile or load time, and wires it up to the type system of the language I'm using. All the ones I've tried just seem to embrace the awfulness of the low-level database access APIs and are just trying to replace the good-enough DSL that is SQL with something worse.
[ Parent
| on HN ]
Re:Myth: Select * is Bad
by johnpmayer on Sunday August 25, 2013 @06:25PM
(#6274008)
http://www.haskell.org/haskellwiki/MetaHDBC
Does exactly that. Runs your SQL against the database at compile time to get type information, which it injects into the program AST.
The closest I've seen an ORM come to this is Squeryl: http://squeryl.org
Which has been superseded by Slick (http://slick.typesafe.com/) and does exactly as the parent says.
In that regard, while not actually an ORM per se, one of the best experiences I've ever had with SQL integration in a language was SAP's ABAP, where column types and data types are (almost?) the exact same thing.
Re:Myth: Select * is Bad
by stonemetal on Sunday August 25, 2013 @10:59PM
(#6274928)
If you are in C# land Dapper does a good job of letting you write SQL and handle the messy put result sets in to objects part of the equation.