Re:Ent: An Entity Framework for Go
by bottlepalm on Sunday October 30, 2022 @10:00PM
(#33401215)
I'd kill for a port of the .Net Entity Framework to JavaScript - the current ORMs for JavaScript are really nothing compared to EF.. If you haven't used it, it is super powerful at selecting super complex structured data from a database super easy. :) It's query format is also the linq standard so you use the same extension methods to work with in-memory collections as you do with database tables.
[ Parent
| on HN ]
Do you have a link that quickly expresses the gist of what makes Entity Framework good/powerful? I tried using it in college for a little project, hit the docs like a brick wall, and went back to Rails. I always struggle “getting to the good parts” with Microsoft’s stuff.
Re:Ent: An Entity Framework for Go
by Foobar8568 on Sunday October 30, 2022 @11:45PM
(#33401828)
Microsoft documents are generally fairly good. I haven't touched much .Net these last 10years but i believe that it took at least EF6 in the original .Net framework to have the main good stuff and be productive, add the core version to the confusion...Latest few core versions should be good as well.
“Go read the docs” is not helpful! I tried that 8 years ago based on HN sentiment about C# and my experience with the Microsoft docs was that they are very detailed but the level of detail makes it difficult to quickly pick up what it’s like to actually use one of their thingies. I walked into the docs for Entity Framework, spent 6 hours trying to get Visual Studio and their suggested development database set up, then gave up and went back to Rails which took 1 apt-get command and 2 Ruby commands.
Re:Ent: An Entity Framework for Go
by unemployable on Monday October 31, 2022 @02:28AM
(#33402630)
It isn't possible because JavaScript doesn't have the required reflection abilities to understand what the anonymous function in
users.Where(u => u.id == id);
means. It can get a string representation, eg. 'u => u.id == id', but it has no access to id, so it won't know what to put in place of $id here: select * from users where id = $id
I used to use EF a lot, and it does feel very easy to write non-complex queries that traverse whatever abstraction it represents the database as, but ultimately, that abstraction is not really what the database is at all, and that can have some downsides.