Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @Timestamp(key: "...", on: .none) functionality #336

Merged
merged 1 commit into from
Jul 14, 2020

Conversation

gwynne
Copy link
Member

@gwynne gwynne commented Jun 19, 2020

Adds new case .none to TimestampTrigger (#336).

Using TimestampTrigger.none on a @Timestamp property makes it act like a normal @OptionalField, so that Fluent never updates the timestamp automatically. Such properties retain the ability to take advantage of TimestampFormats for explicitly defining the format of the timestamp value in the database.

Note: Technically, since this adds an enum case, it would be a semver-major change, breaking source compatibility for anyone switching over the TimestampTrigger type. However, the expectation is doing this would be very rare.

…d manually and never overwritten by Fluent, but can still leverage the full power of TimestampFormats. It's a bit sad that this requires only one very trivial line of code in implementation but it takes 15 times that to have even very simple tests for it.
@gwynne gwynne added enhancement New feature or request semver-minor Contains new APIs labels Jun 19, 2020
@gwynne gwynne self-assigned this Jun 19, 2020
Copy link
Member

@MrLotU MrLotU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM; I don't think this breaking change should be a big issue, but not 100% sure :L

@gwynne
Copy link
Member Author

gwynne commented Jun 19, 2020

I concur with @0xTim's concern; waiting on @tanner0101 to review.

Copy link
Member

@tanner0101 tanner0101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@tanner0101 tanner0101 merged commit 26b08df into master Jul 14, 2020
@tanner0101 tanner0101 deleted the untriggered-timestamp-properties branch July 14, 2020 18:37
@tanner0101
Copy link
Member

These changes are now available in 1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request semver-minor Contains new APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants