3 ms·
> What's wrong with just writing pure SQL? What's wrong with wanting to abstract something that only the database care about? when you want to read a file in
by aikah 12y ago
> What's wrong with just writing pure SQL?
What's wrong with wanting to abstract something that only the database care about? when you want to read a file in go,do you execute a shell command like "cat myfile.txt" and pipe the result? or do you use a pure go api ?
Each time you do an http request,do you send headers and body through tcp sockets as text,or do you use an http api?
- enneff 12y agoI'm no sure the point your making, but you appear to be agreeing with the OP. Go's os.Open function is a thin veneer around the open system call, which is the same thing cat uses. The HTTP package provides as thin a layer over actual HTTP as possible. The story with database/sql is the same.
- aikah 12y agomy point is ,you dont write raw tcp text commands when you do an http request in Go(well you can,but what's the point when... )...There is an abstraction layer,you deal with "objects",not HTTP text commands directly. I dont see why it's nice to have an abstraction for HTTP but as soon as it comes to RDBMSs, string commands should be the way to go...
- shanemhansen 12y agoYour analogy is flawed. Using a httplib for http is like using a database driver for SQL. An ORM for http would be something like Ruby's Active Resource or some other abstraction that his all URLs and query strings from you.
- eropple 12y agoBecause it's a massive impedance mismatch for most nontrivial cases. Relational and object systems have never played particularly well together. The contention is, and it's one that I agree with, is that the tooling that inevitably builds up to address this impedance mismatch is too hard to usefully generalize in a way that doesn't end up taking over your project. (This is why I dig mappers for document-based databases and avoid them for relational ones.)