Live data from Hacker News

Google's new pipe syntax in SQL

simonwillison.net

41–50 of 192 posts

Re: Google's new pipe syntax in SQL

#42

My big wish for SQL is for single row inserts to have a {key: value} syntax.

In ClickHouse you can do

    INSERT INTO table FORMAT JSONEachRow {"key": 123}
It works with all other formats as well.

Plus, it is designed in a way so you can make an INSERT query and stream the data, e.g.:

    clickhouse-client --query "INSERT INTO table FORMAT Protobuf" 

Re: Google's new pipe syntax in SQL

#43
post #38
post #13

Earlier quoted context omitted.

That comment where he explains why he's not rushing to add new unproven SQL syntax to SQLite is fascinating: > My goal is to keep SQLite relevant and viable through the year 2050. That's a long time from now. If I knew that standard SQL was not going to change any between now and then, I'd go ahead and make non-standard extensions that allowed for FROM-clause-first queries, as that seems like a useful extension. The…

It's so ambitious in an almost boring way, exactly the right steward for a project like this

Dr. Hipp is one of my heroes. He seems to labor quietly in semi obscurity for decades, and at the end of it he's produced some amazing software. I was tickled by the curfuffle over his use of a set of guidelines for living in a Christian monastery as SQLite's code of ethics for the purpose of checking a box on an RFQ (part of the fallout of the libsql fork), because he does seem like a sort of programmer monk. (For what it's worth, as an agnostic, I've read them several times and found them unobjectionable. While I think the drama was unnecessary, the libsql people are doing interesting work.)

I choose never to meet this man and be disabused of this notion. Shine on, doctor.

Re: Google's new pipe syntax in SQL

#44

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.

I find this [1] from this [2]. Seems like a good explanation. It doesn't exist on Wikipedia though.

[1] https://github.com/raganwald-deprecated/homoiconic/blob/mast...

[2] https://stackoverflow.com/a/285973/88231

Re: Google's new pipe syntax in SQL

#45
post #9

Title should probably be changed, since the article is about using AI to convert a PDF to semantic HTML.

A surprising problem I'm seeing with maintaining a link blog is that articles from it occasionally get submitted to Hacker News, where people inevitably call them out as not being as appropriate as the source they are linking to - which is fair enough! That's why I don't tend to submit them myself. This particular post quickly turned into a very thinly veiled excuse for me to complain about PDFs, then demonstrate a G…

Have you seen gist.io?

If you replace `gist.github.com//` -> `/" rel="nofollow">https://gist.io/@/`, you get a gist with nice typography.

https://gist.io/@simonw/46a33d66e069efe5c10b63625fdabb4e is the same gist you linked, but nicer to read

Re: Google's new pipe syntax in SQL

#47
> This remains a long-standing pet peeve of mine. PDFs like this are horrible to read on mobile phones, hard to copy-and-paste from ...

I've never understood why copying text from digitally native PDFs (created directly from digital source files, rather than by OCR-ing scanned images) is so often such a poor experience. Even PDFs produced from LaTex often contain undesirable ligatures in the copied text like fi and fl. Text copied from some Springer journals sometimes lacks space between words or introduces unwanted space between letters in a word ... Is it due to something inherent in PDF technology?

Re: Google's new pipe syntax in SQL

#48

> This remains a long-standing pet peeve of mine. PDFs like this are horrible to read on mobile phones, hard to copy-and-paste from ... I've never understood why copying text from digitally native PDFs (created directly from digital source files, rather than by OCR-ing scanned images) is so often such a poor experience. Even PDFs produced from LaTex often contain undesirable ligatures in the copied text like fi and fl.…

ligatures like fi fl ffi ffl etc are for changes in fonts specific to rendering correctly on a screen or printer. It's intended to be a _rendered_ format, rather than a parse-able format.

Well formatted epub and HTML generally are usually intended to update to end user needs and better fit available layout space.

Re: Google's new pipe syntax in SQL

#49

> This remains a long-standing pet peeve of mine. PDFs like this are horrible to read on mobile phones, hard to copy-and-paste from ... I've never understood why copying text from digitally native PDFs (created directly from digital source files, rather than by OCR-ing scanned images) is so often such a poor experience. Even PDFs produced from LaTex often contain undesirable ligatures in the copied text like fi and fl.…

It is a shame that CSS pagination is still a mess. Not that I like CSS, but it would go a long way towards unlocking some layouts from PDF.

Re: Google's new pipe syntax in SQL

#50
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.

There is https://github.com/linq2db/linq2db which is LINQ to SQL reincarnated.

Of course there's EF Core too.

Post reply on HN