Hacker News new | ask | show | jobs
by runevault 1362 days ago
ORMs where you don't write sql make me nervous, though it doesn't help the main version of this I used was raw linq-to-sql (not Entity Framework), and it could be very hard to convince linq to generate the correct sql for what I was doing (I once had to write my relationships backwards else it kept generating sub queries).

But .NET also has Dapper where it lets you write all the SQL and then it just handles the binding of data into objects, which having that handled for me is great.

2 comments

I had a positive experience with Linq2db: https://github.com/linq2db/linq2db

I mention because I had something of the opposite experience with it. It not only ended up yielding the correct queries, but I saw a significant increase in performance. And the neat thing about it, beyond ORM and linq-to-sql, is a common interface amongst providers - so you can do things like swap from SQLite to Postgres with 1 line* of code, so long as you're not using provider specific extensions.

Huh interesting. If I ever do any personal projects that need a DB I'll have to take a look at this. Appreciate the link.
It does allow for query access also: https://redbeanphp.com/index.php?p=/querying

But, yeah, that's not the normal path.