pgo icon indicating copy to clipboard operation
pgo copied to clipboard

Timestamp handling

Open michaeljones opened this issue 2 months ago • 4 comments

I've built this on top of the 0.7.0 tag but that isn't in main yet and so it adds to the diff

This adds pgo.timestamp as a converter function from #(#(Int, Int, Int), #(Int, Int, Int)) to a pgo.Value. This provides some indication of how to handle timestamp columns with this library. Also extends the tests to cover this.

As noted in the commit message, I think it might be reasonable to have a pgo/dynamic.timestamp module/function to decode the tuple structure that pgo uses to make that side easier too. Happy to add that if it seems relevant.

Not sure if any of this is appropriate. Happy to be told if it isn't. It is based off my attempts to explore this area and better understand how one is meant to handle timestamps with this library. I think similar work could go into timestamps with time zones too but I realise there might be issues with the underlying pgo library there. Not sure.

michaeljones avatar May 04 '24 13:05 michaeljones