Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
I don't want to learn your garbage query language (erikbern.com)
5 points by sebg on Dec 11, 2022 | hide | past | favorite | 2 comments


I don’t agree. SQL gets pretty bad in some places, such as recursive common table expressions. I also hate writing x twice in

   SELECT x,COUNT(*) FROM y GROUP BY x
I know you can write GROUP BY 1 but that makes me feel a little dirty. The SQL specification itself is poor and different SQL dialects have different type systems so that complex queries aren’t really portable between Oracle and Microsoft SQL server. Potentially you can do SQL at multiple scale in the same system (HypersonicSQL in RAM, SQLlite locally on disk, a client server RDBMS for the big stuff) but differences in dialects and no universal method of backup and restore all make it hard. SPARQL is much better specifies and better compatible with multiple scale implementations but unfortunately the people involved got ‘Standards Fatigue’ and it is not staying relevant.

Datalog kicks ass.

There’s something to say for query languages that are like SQL but work natively on JSON-like structures (AQL in Arangodb), also for languages that have graph processing features (same). We also have had 20 years of improvements in ORMs from when the most popular complaints about ORMs have been written. Catalog

Most of all I like metaprogramming with queries and it works better that metaprogramming for normal programming languages. The irregularity of SQL makes that harder (though JooQ does pretty well), languages like SPARQL and datalog do a lot better. Those document-oriented languages can help you avoid joins that are awkward with SQL.





Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: