News for hackers. Stuff that matters.
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr... by emidln on Tuesday July 10, 2018 @10:24AM (#17498349)
We abstracted JSONB operations into the Clojure Query AST library HoneySQL and never really looked back. It was something one person on the team learned thoroughly for a half day and promptly forgot about. Now we say things like:

    (jsonb/get-in :jsonb-column [:field :sub-field])
    ;; jsonb_column#>>'{field, subfield}'

    (jsonb/get-in :jsonb-column [:field :sub-field] "default")
    ;; COALESCE(jsonb_column#>>'{field, subfield}', 'default')
    
    (jsonb/get-in :jsonb-column [:field])
    ;; jsonb_column->>'field'
Which each generate the appropriate data structures for HoneySQL to do some combination of using #>>, ->> and COALESCE as needed. I can't imagine this is too difficult in any language. Even if you are writing static SQL, I don't think learning the syntax to go with a feature is too high of an ask to use a feature.
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr... by ganonm on Tuesday July 10, 2018 @10:36AM (#17498449)
Nice library - I agree with you, learning the syntax shouldn't be considered a downside of an otherwise novel feature, my concern is mainly around the appropriateness of the feature in the context of problems that already have well established relational solutions