pgo
pgo copied to clipboard
Timestamp handling
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.
I've added the helper function with docs of some kind. I'm not sure how you'd like it phrased and I'm not sure of the calling convention. I've got with "no parens" at the call site which I think makes sense for a plain value.
I think something may have gone awry with your rebase, there's additional changes in the diff
Yup, I seem to have gotten confused. I think it is sorted now.
Would you mind updating the changelog? 🙏
Done :) Please feel free to adjust any wording or anything else as you see fit.