Closed
Description
Right now, to save an object to InfluxDb, you need to add each field individually to a query like so
#[derive(Deserialize, InfluxDbWriteable)]
struct Humidity {
time: i32,
humidity: i32,
}
let measurement = Humidity {
time: 11,
humidity: 1,
}
let write_query = InfluxDbQuery::write_query(Timestamp::HOURS(&measurement.time), "humidity")
.add_field("humidity", &measurement.humidity);
This should be easily inferable by a procedural macro so that there could be a new function like
let write_query = InfluxDbQuery::write_query(&humidity);