5 ms·
I don't like those seemingly arbitrary json operators. ->> #>> ?& @>. IMHO, they'd be easier to understand with proper function names.
by thisgoodlife 6y ago
I don't like those seemingly arbitrary json operators. ->> #>> ?& @>. IMHO, they'd be easier to understand with proper function names.
- baq 6y agoThey’d have to invent a syntax for infix function calls akin to Haskell’s backticks which other people would complain about. (I’m happy we don’t have to write queries in yaml, only half joking.)
- wayneftw 6y agoOther popular databases have named functions for this: https://www.sqlite.org/json1.html https://www.sqlite.org/json1.html https://dev.mysql.com/doc/refman/8.0/en/json-function-reference.html https://dev.mysql.com/doc/refman/8.0/en/json-function-refere... https://docs.microsoft.com/en-us/sql/t-sql/functions/json-functions-transact-sql?view=sql-server-ver15 https://docs.microsoft.com/en-us/sql/t-sql/functions/json-fu... (Too bad there was no standard for these.)
- eyelidlessness 6y agoAnd Postgres has a ton of `JSON_` and `JSONB_` functions, so the weird operators are even more baffling.
- eyelidlessness 6y agoWhy have infix anything? Functions have names and they're always the first symbol in a function call. SQL also has a convention of using `PLAIN ENGLISH WORDS` which declaratively describe the result set or operation. The weird JSONB operators are just... way out of place.