feat: Support conversion of Unix timestamps in timestamptz#570
Merged
kodiakhq[bot] merged 3 commits intomainfrom Jan 4, 2023
Merged
feat: Support conversion of Unix timestamps in timestamptz#570kodiakhq[bot] merged 3 commits intomainfrom
kodiakhq[bot] merged 3 commits intomainfrom
Conversation
Member
|
What about UnixMillis? How can you be sure the given timestamp is unix (ie. seconds)? (Auto-detection might work) |
candiduslynx
approved these changes
Jan 4, 2023
⏱️ Benchmark results
|
Contributor
Author
@disq Yeah, there are many variations (also unix time + milliseconds as float), but I think it's about providing a reasonable default in the SDK (which we can document). If an int field contains something other than Unix seconds, it will need to be converted first, but this should cover most cases without the need for additional code. As for unix millis specifically, I don't think we can reliably tell which one is which (imagine the time is supposed to represent 1 second after 1 January 1970, for example). |
yevgenypats
approved these changes
Jan 4, 2023
kodiakhq bot
pushed a commit
that referenced
this pull request
Jan 4, 2023
🤖 I have created a release *beep* *boop* --- ## [1.18.0](v1.17.2...v1.18.0) (2023-01-04) ### Features * Add Transformer for tables (codegen replacement) ([#564](#564)) ([a643ddf](a643ddf)) * Support conversion of Unix timestamps in timestamptz ([#570](#570)) ([6b948ab](6b948ab)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for Unix timestamps to the Timestamptz type. I think it's reasonable to expect that an integer type is to be interpreted as unix time, and a custom resolver should be used if this is not the case.