Live data from Hacker News

Google's new pipe syntax in SQL

simonwillison.net

21–30 of 192 posts

Re: Google's new pipe syntax in SQL

#21

Previous submissions on the paper itself: https://news.ycombinator.com/item?id=41321876 (first) https://news.ycombinator.com/item?id=41338877 (plenty of discussions) I tried this new syntax and this seems a reasonable proposal for complex analytical queries. This new syntax probably does not change most simple transactional queries though. The syntax matches the execution semantic more closely, which means you less l…

Kinda looks like a half-assed version of what PRQL does. Like, if we’re going to have nonstandard sql, let’s just fix a whole bunch of things, not just one or two?

> Like, if we’re going to have nonstandard sql, let’s just fix a whole bunch of things, not just one or two?

I think they intentionally kept themselves away from massive redesign of the languages, which has a good chance of becoming multi decades of frustrating death march. I know a number of such cases from C++ standard proposals and probably the team wanted to avoid it.

Re: Google's new pipe syntax in SQL

#22
post #20
post #12

This reminds me .NET's short lived Linq to SQL; There was a talk at the time, but I can't find the video: http://jaoo.dk/aarhus2007/presentation/Using+LINQ+to+SQL+to+... . Basically, it was a way to cleanly plug SQL queries into C# code. It used this sort of ordering (where the constraints come after the thing being constrained); it needed to do so for IntelliSense to work.

"Short-lived"? LINQ is very much alive in the C# ecosystem. And FROM-first syntax absolutely makes more sense, regardless of autocomplete. You should put the "what I need to select" after the "what I'm selecting from", in general.

LINQ yes, but they killed off the component not long after introducing it.

Re: Google's new pipe syntax in SQL

#23
post #12

This reminds me .NET's short lived Linq to SQL; There was a talk at the time, but I can't find the video: http://jaoo.dk/aarhus2007/presentation/Using+LINQ+to+SQL+to+... . Basically, it was a way to cleanly plug SQL queries into C# code. It used this sort of ordering (where the constraints come after the thing being constrained); it needed to do so for IntelliSense to work.

> This reminds me .NET's short lived Linq to SQL; "Short lived"? Its still alive, AFAIK, and the more popular newer thing for the same use case, Linq to Enntities, has the same salient features but (because it is tied to Entity Framework and not SQL Server specific) is more broadly usable.

It was in 3.5 only.

If they've replaced it with something else in the last decade and a half that does not mean that they didn't get rid of it, or that it wasn't short lived.

https://learn.microsoft.com/en-us/dotnet/framework/data/adon...

Re: Google's new pipe syntax in SQL

#24
post #22
post #20

Earlier quoted context omitted.

"Short-lived"? LINQ is very much alive in the C# ecosystem. And FROM-first syntax absolutely makes more sense, regardless of autocomplete. You should put the "what I need to select" after the "what I'm selecting from", in general.

LINQ yes, but they killed off the component not long after introducing it.

[deleted]

Re: Google's new pipe syntax in SQL

#25
post #23

Earlier quoted context omitted.

> This reminds me .NET's short lived Linq to SQL; "Short lived"? Its still alive, AFAIK, and the more popular newer thing for the same use case, Linq to Enntities, has the same salient features but (because it is tied to Entity Framework and not SQL Server specific) is more broadly usable.

It was in 3.5 only. If they've replaced it with something else in the last decade and a half that does not mean that they didn't get rid of it, or that it wasn't short lived. https://learn.microsoft.com/en-us/dotnet/framework/data/adon...

LINQ is not the same as LINQ-to-SQL. The former is a language feature, the latter a library (one of many) that uses that feature.

Re: Google's new pipe syntax in SQL

#26
post #23

Earlier quoted context omitted.

> This reminds me .NET's short lived Linq to SQL; "Short lived"? Its still alive, AFAIK, and the more popular newer thing for the same use case, Linq to Enntities, has the same salient features but (because it is tied to Entity Framework and not SQL Server specific) is more broadly usable.

It was in 3.5 only. If they've replaced it with something else in the last decade and a half that does not mean that they didn't get rid of it, or that it wasn't short lived. https://learn.microsoft.com/en-us/dotnet/framework/data/adon...

Yeh. Linq to sql was a much more lightweight extension than EF, and was killed due to internal warring at MS.

Database people were investing a lot of time and energy on doing things “properly” with EF, and this scrappy little useful tool, linq to sql, was seen as a competitor.

Re: Google's new pipe syntax in SQL

#27
If anyone is interested in the theoretical background to the thrush combinator, a.k.a. "|>", here is one using Ruby as the implementation language:

https://leanpub.com/combinators/read#leanpub-auto-the-thrush

Being a concept which transcends programming languages, a search for "thrush combinator" will yield examples in several languages.

Re: Google's new pipe syntax in SQL

#28
post #23

Earlier quoted context omitted.

It was in 3.5 only. If they've replaced it with something else in the last decade and a half that does not mean that they didn't get rid of it, or that it wasn't short lived. https://learn.microsoft.com/en-us/dotnet/framework/data/adon...

LINQ is not the same as LINQ-to-SQL. The former is a language feature, the latter a library (one of many) that uses that feature.

Did you reply to the wrong person? Because I'm not the guy that didn't know that.

Re: Google's new pipe syntax in SQL

#29
post #26
post #23

Earlier quoted context omitted.

It was in 3.5 only. If they've replaced it with something else in the last decade and a half that does not mean that they didn't get rid of it, or that it wasn't short lived. https://learn.microsoft.com/en-us/dotnet/framework/data/adon...

Yeh. Linq to sql was a much more lightweight extension than EF, and was killed due to internal warring at MS. Database people were investing a lot of time and energy on doing things “properly” with EF, and this scrappy little useful tool, linq to sql, was seen as a competitor.

I quite liked it in the 5 minutes it existed - it was just really easy to use.

Re: Google's new pipe syntax in SQL

#30

Is there research on what is easier to read when you are sifting through many queries? I like the syntax for reading what the statement expects to output first, even though I agree that I don’t write them select first. I feel like this might be optimizing the wrong thing. Although the example is nice, it does not show 20 tables joined first, which will really muddle it.

The select list is meaningless without everything that follows. Knowing that a query selects "id, "date" tells you nothing without knowing the table, the search criteria, etc.
Post reply on HN