Skip to content

Conversation

blasrodri
Copy link
Contributor

This attribute signals influx to avoid inserting a field

ref: #76

Description

{ describe your changes here }

Checklist

  • [x ] Formatted code using cargo fmt --all
  • [ x] Linted code using clippy cargo clippy --all-targets --all-features -- -D warnings
  • [ x] Updated README.md using cargo readme -r influxdb -t ../README.tpl > README.md
  • [ x] Reviewed the diff. Did you leave any print statements or unnecessary comments?
  • [ x] Any unfinished work that warrants a separate issue captured in an issue with a TODO code comment

This attribute signales influx to avoid inserting a field
@msrd0
Copy link
Collaborator

msrd0 commented Dec 15, 2020

I dislike introducing more attributes with names unrelated to influxdb - instead, I'd suggest we introduce one influxdb attribute and then use inner tags, like most other rust projects including serde do. The struct would then look something like this:

#[derive(InfluxDbWriteable)]
struct WeatherReadingIgnoredField {
    time: DateTime<Utc>,
    humidity: i32,
    #[influxdb(tag)]
    wind_strength: Option<u64>,
    #[influxdb(ignore)]
    temperature: u64,
}

This would however be a breaking change, whereas just adding another tag is a non-breaking change. We could also support both for a while, but (deprecation) warnings are not a thing until diagnostics are stabilized.

@Empty2k12
Copy link
Collaborator

Empty2k12 commented Dec 15, 2020

I have no problems with breaking changes. We're well below 1.0 and therefore semantic stability cannot be guaranteed.

@blasrodri
Copy link
Contributor Author

I dislike introducing more attributes with names unrelated to influxdb - instead, I'd suggest we introduce one influxdb attribute and then use inner tags, like most other rust projects including serde do. The struct would then look something like this:

#[derive(InfluxDbWriteable)]
struct WeatherReadingIgnoredField {
    time: DateTime<Utc>,
    humidity: i32,
    #[influxdb(tag)]
    wind_strength: Option<u64>,
    #[influxdb(ignore)]
    temperature: u64,
}

This would however be a breaking change, whereas just adding another tag is a non-breaking change. We could also support both for a while, but (deprecation) warnings are not a thing until diagnostics are stabilized.

I made an attempt here
Could you please review it and help me out? It's currently failing.

Thanks!

@blasrodri
Copy link
Contributor Author

closing in favor of #81

@blasrodri blasrodri closed this Dec 16, 2020
@blasrodri blasrodri deleted the add-ignored-field branch December 16, 2020 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants