top | item 39541816

(no title)

gtroja | 2 years ago

The only thing I like in SQL is that is almost the same language in decades. Learn it once and you're done. If you really need, you could write macros yourself. I don't see the value of learning a new language to do the same thing

discuss

order

dvdkon|2 years ago

Given how many new programming languages have become widely used in the time since SQL's creation, it seems many others do se some value. For a mostly direct parallel to PQL, see CoffeeScript and TypeScript.

gtroja|2 years ago

I love LINQ just because it made HOF look like SQL

quaunaut|2 years ago

SQL's nonsensical handling of null is reason enough to learn other query languages.

munk-a|2 years ago

Do you mean that NULL <> NULL and NULL infects boolean logic?

NULL is always an awkward thing to deal with - how you want to handle it depends on the specific thing you're trying to accomplish. I'd probably prefer it if NULL equaled NULL when dealing with where conditions but it actually makes join evaluations a lot cleaner - if NULL equaled NULL then joining on columns with nulls would get really weird.

At the end of the day IS NULL and IS DISTINCT FROM/IS NOT DISTINCT FROM exist so you can handle cases where it'd be weird.

FridgeSeal|2 years ago

Using this language on top won’t solve that though, it still compiles into sql, warts and all.

layer8|2 years ago

Pql uses the same NUll handling, since it just passes it through to the generated SQL.

pjerem|2 years ago

> The only thing I like in SQL is that is almost the same language in decades

So you do agree that the rest of SQL is broken. That’s why there is a value in creating (and learning) such new languages.

kubota|2 years ago

I strongly disagree that SQL is broken. Try using JPA or your favorite ORM on a large project with a complex entity graph. It is a nightmare having to ctrl-click deep into the entity graph to see what annotations are on some great-grandchildren to get an idea as to what query is being executed. When working with relational data SQL has always been the ideal tool for the job on the projects I've worked on.