5 ms·
Can’t wait for something better to come along. The text orientedness of SQL is annoying. Something like Linq without the underlying SQL.
by adamnemecek 4y ago
Can’t wait for something better to come along. The text orientedness of SQL is annoying. Something like Linq without the underlying SQL.
- jdmichal 4y agoIsn't "LINQ without the underlying SQL" simply list comprehensions?
- adamnemecek 4y agoWell plus serialization that’s not SQL.
- pjc50 4y agoMicrosoft call it "LINQ to objects": https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/linq-to-objects https://docs.microsoft.com/en-us/dotnet/csharp/programming-g...
- smitty1e 4y agoUse an object-relational mapper and leave the boring stuff to a library.
- tehlike 4y agoSadly the choice of sql tends to make underlying framework very complicated and sometimes incapable. Some things got easier to express with SQL after Json_agg in postgres became a thing (now you can do multi-depth relations without blowing up the result table with Cartesian product) but it's still massive pain in the ass and Json agg has performance overhead too.
- smitty1e 4y agoEspecially for reporting, I'm just as happy to write a serious piece of SQL and execute it directly. This is the joy of SQLAlchemy: great features when you want to use them; escape hatches when you don't.
- tehlike 4y agoRight, most ORM tools give an escape hatch to execute raw SQL queries. However, even though SQL is turing complete, it's not a great language for retrieval imho. It's probably an artifact of the underlying relational models (and the relational output it has to generate) but still.
- smitty1e 4y agoI was all set to disagree with you, but a bit of googling yields => https://localcoder.org/is-sql-or-even-tsql-turing-complete https://localcoder.org/is-sql-or-even-tsql-turing-complete
- tehlike 4y agoIt could have been wrong, but main argument was whether SQL was a good language for retrieval or not, and for me that's a no. It's probably subjective though :)
- __MatrixMan__ 4y agoI hate ORMs. After days of fumbling in the dark you finally isolate the problematic query, post it like "guys I found it," and still nobody speaks up. So you hack the ORM to attach tracebacks as comments to each query, retest everything, and finally git-blame your way to somebody who owns that bit of code and they're always like "wait, the ORM did WHAT?" I'd rather grep code for SQL any day.
- beached_whale 4y agoI know not what you ment but just mentioning that if one uses entity framework or linq to sql in .net, linq should work with sqlite.
- tehlike 4y agoAmen. I made this point over and over. Sql is fairly annoying to deal with, linq is very close to me being perfect, prql is close https://github.com/prql/prql https://github.com/prql/prql
- boyter 4y agoThe thing I always liked about linq was it’s lazy evaluation. You could write simple selects on your data model and join and filter in the service. Allowing unit tests that operated on the joins. I’m yet to find a better way to write crud apps than that pattern.