Fork me on GitHub

Postgres and jsonb is quite nice for this.


You can even use those json fields (or any jsonpath expression) for queries, and I think even indexing. Though indexing assumes you know exactly the shape of your data so if so, why put it in json?


"Schemaless" indexing works with JSONB, but only for equality and inequality - you create a GIN index on the whole field


We’re migrating from mongo to pg and jsonb plays a significant role in it. There are things that we don’t want to “model out” straight away, even though the data shape is known, so we just stick it in a jsonb blob for now.

👀 1

We also have a concept of custom fields, and for now, they’ll be stored in a jsonb blob and their integrity will be handled by application code.


Does anyone know what this is? It's on the river by my flat.


Over a couple of weeks it's been moving up the river.

Martynas M18:01:30

But where are the workers...? I can't believe it does that on its own... Did you try to ask workers?


My guess would be something to take core samples of the river bottom. Alternate guess would be laying some kind of pipeline.


I've only ever seen a worker on it one day, and he was too far from the edge of the river to be able to speak to him


Everyday though I see it in a different location. COuld very well be laying pipes, and the time of day I pass it (evening), the workers have gone home

Martynas M18:01:49

There are so much stuff on that platform. They are definetly changing something at the bottom. Also if it would've been sample collection then they would need one diver guy on any boat.


I wonder how it moves


that propeller probably flips down into the water and the legs go up

mario-star 1

What river is that @U013YN3T4DA?


The River Clyde in Glasgow, Scotland


I googled for lake and river "core" sampling barge and clicked on Images, got a lot of photos that kinda look like that.

👀 1
Martynas M03:01:35

Which means those are not pipes and instead those are what they drill into the ground. Nice.


Glasgow is a great place with great people


Looks like a shallow water jack-up barge - pretty cool things! 🙂


I’ve been thinking about exception handling recently, here’s a little something I cooked up:

(defn main [a b]
  ;; If do-a throws an ExceptionInfo with {:type :some-ex}, returns :failure
   (let [x (try' (do-a a)
                 {:some-ex (constantly :failure)})
         y (do-b b)]
Writeup, justification, and code: Thoughts?

Joshua Suskalo16:02:40

I saw you mention this in another thread, and I thought I'd throw my hat in the ring and show what the same control flow would look like in , which produces something slightly more verbose but which I think is a little more clear about the control flow.


My implementation was inspired by farolero’s! Credit where credit is due 🙂

Joshua Suskalo01:02:49

Oh that's really cool!

Joshua Suskalo02:02:30

Glad to hear my work can be an inspiration for people. :)


for a project I'd work on, I would find the complexity of a conditional inside catch to be less cognitive overhead, compared to learning two new try macro variants


also I've never had try/catch like that inside a handler, instead I have used a middleware that wraps the handlers and catches their exceptions


the errors are rarely handler specific, and usually cross their concerns, instead being in categories like "auth missing" / "db connection failure" / "remote api failure"


If all of your errors fit in nice global categories, then this probably doesn’t solve a problem you have


In the projects I’m currently working on, most endpoints have domain-specific failure modes that, while you can force them into global categories, I find that doing so makes it hard to tell what failure modes can occur in each endpoint.

hiredman22:01:36 might be something to look it, I like it because it fairly clearly communicates how to respond to a given error


even with domain specific errors, I don't see why you couldn't put the exception catching in a middleware used with endpoints in that domain


but of course you find this solution clearer, I'm simply answering the question posed, those were my thoughts


I know my handlers usually don't throw exceptions like that, so maybe more monadic in style, check some condition, return error response or continue on to do other stuff


usually wrapped in a general "just in case" exception catching