3 ms·
> With a bit of client-side logic, it's easy to transform that into this [example here] without the need to use json as a middleman. The result in your example
by taffer 1y ago
> With a bit of client-side logic, it's easy to transform that into this [example here] without the need to use json as a middleman.
The result in your example looks exactly like JSON. Am I missing something?
Also, what is the point of avoiding JSON? Your client has to unmarshal the result either way.
- bccdee 1y agoThe json in my example would be generated in client code from the rows returned by the query, which I represented as CSV. The client's representation could just as easily be objects or protobufs or whatever, but I figured json would be a convenient way to portray nested data. It's worth avoiding json on the wire if possible, because the extra layer of encoding will complicate things. Any good postgres integration will know how to safely deserialize and discriminate between (e.g.) DateTime and DateTimeWithTimeZone. But with json, everything's stringified.