Skip to content

Commit 10876c6

Browse files
committed
Update CHANGELOG
1 parent 7d6ad27 commit 10876c6

File tree

3 files changed

+79
-58
lines changed

3 files changed

+79
-58
lines changed

CHANGELOG.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.1.0] - 2020-03-17
11+
12+
This adds `#[derive(InfluxDbWriteable)]` for Structs, fixes escaping for the line-protocol and improves timestamp handling.
13+
14+
### Added
15+
16+
- `#[derive(InfluxDbWriteable)]` for deriving struct writing ([@msrd0](https://github.com/msrd0))
17+
18+
### Changed
19+
20+
- Change type of timestamp-variants to `u128` ([@mario-kr](https://github.com/mario-kr))
21+
22+
### Fixed
23+
24+
- Use `rfc3339` as default timestamp precision ([@zjhmale](https://github.com/zjhmale))
25+
1026
## [0.0.6] - 2020-02-07
1127

1228
### Changed
@@ -60,9 +76,10 @@ This release removes the prefix `InfluxDb` of most types in this library and ree
6076
- Improved Test Coverage: There's now even more tests verifying correctness of the crate (#5)
6177
- It's no longer necessary to supply a wildcard generic when working with serde*integration: `client.json_query::<Weather>(query)` instead of `client.json_query::<Weather, *>(query)`
6278

63-
[unreleased]: https://github.com/Empty2k12/influxdb-rust/compare/v0.0.6...HEAD
79+
[unreleased]: https://github.com/Empty2k12/influxdb-rust/compare/v0.1.0...HEAD
80+
[0.1.0]: https://github.com/Empty2k12/influxdb-rust/compare/v0.0.6...v0.1.0
6481
[0.0.5]: https://github.com/Empty2k12/influxdb-rust/compare/v0.0.5...v0.0.6
65-
[0.0.5]: https://github.com/Empty2k12/influxdb-rust/compare/v0.0.5...v0.0.5
82+
[0.0.5]: https://github.com/Empty2k12/influxdb-rust/compare/v0.0.4...v0.0.5
6683
[0.0.4]: https://github.com/Empty2k12/influxdb-rust/compare/v0.0.3...v0.0.4
6784
[0.0.3]: https://github.com/Empty2k12/influxdb-rust/compare/v0.0.2...v0.0.3
6885
[0.0.2]: https://github.com/Empty2k12/influxdb-rust/releases/tag/v0.0.2

README.md

+30-27
Original file line numberDiff line numberDiff line change
@@ -61,34 +61,37 @@ use influxdb::{Client, Query, Timestamp};
6161
use influxdb::InfluxDbWriteable;
6262
use chrono::{DateTime, Utc};
6363

64-
// Connect to db `test` on `http://localhost:8086`
65-
let client = Client::new("http://localhost:8086", "test");
66-
67-
#[derive(InfluxDbWriteable)]
68-
struct WeatherReading {
69-
time: DateTime<Utc>,
70-
humidity: i32,
71-
#[tag] wind_direction: String,
64+
#[tokio::main]
65+
async fn main() {
66+
// Connect to db `test` on `http://localhost:8086`
67+
let client = Client::new("http://localhost:8086", "test");
68+
69+
#[derive(InfluxDbWriteable)]
70+
struct WeatherReading {
71+
time: DateTime<Utc>,
72+
humidity: i32,
73+
#[tag] wind_direction: String,
74+
}
75+
76+
// Let's write some data into a measurement called `weather`
77+
let weather_reading = WeatherReading {
78+
time: Timestamp::Hours(1).into(),
79+
humidity: 30,
80+
wind_direction: String::from("north"),
81+
};
82+
83+
let write_result = client
84+
.query(&weather_reading.into_query("weather"))
85+
.await;
86+
assert!(write_result.is_ok(), "Write result was not okay");
87+
88+
// Let's see if the data we wrote is there
89+
let read_query = Query::raw_read_query("SELECT * FROM weather");
90+
91+
let read_result = client.query(&read_query).await;
92+
assert!(read_result.is_ok(), "Read result was not ok");
93+
println!("{}", read_result.unwrap());
7294
}
73-
74-
// Let's write some data into a measurement called `weather`
75-
let weather_reading = WeatherReading {
76-
time: Timestamp::Hours(1).into(),
77-
humidity: 30,
78-
wind_direction: String::from("north"),
79-
};
80-
81-
let write_result = client
82-
.query(&weather_reading.into_query("weather"))
83-
.await;
84-
assert!(write_result.is_ok(), "Write result was not okay");
85-
86-
// Let's see if the data we wrote is there
87-
let read_query = Query::raw_read_query("SELECT * FROM weather");
88-
89-
let read_result = client.query(&read_query).await;
90-
assert!(read_result.is_ok(), "Read result was not ok");
91-
println!("{}", read_result.unwrap());
9295
```
9396

9497
For further examples, check out the Integration Tests in `tests/integration_tests.rs`

influxdb/src/lib.rs

+30-29
Original file line numberDiff line numberDiff line change
@@ -32,36 +32,37 @@
3232
//! use influxdb::InfluxDbWriteable;
3333
//! use chrono::{DateTime, Utc};
3434
//!
35-
//! # #[tokio::main]
36-
//! # async fn main() {
37-
//! // Connect to db `test` on `http://localhost:8086`
38-
//! let client = Client::new("http://localhost:8086", "test");
39-
//!
40-
//! #[derive(InfluxDbWriteable)]
41-
//! struct WeatherReading {
42-
//! time: DateTime<Utc>,
43-
//! humidity: i32,
44-
//! #[tag] wind_direction: String,
35+
//! #[tokio::main]
36+
//! async fn main() {
37+
//! // Connect to db `test` on `http://localhost:8086`
38+
//! let client = Client::new("http://localhost:8086", "test");
39+
//!
40+
//! #[derive(InfluxDbWriteable)]
41+
//! struct WeatherReading {
42+
//! time: DateTime<Utc>,
43+
//! humidity: i32,
44+
//! #[tag] wind_direction: String,
45+
//! }
46+
//!
47+
//! // Let's write some data into a measurement called `weather`
48+
//! let weather_reading = WeatherReading {
49+
//! time: Timestamp::Hours(1).into(),
50+
//! humidity: 30,
51+
//! wind_direction: String::from("north"),
52+
//! };
53+
//!
54+
//! let write_result = client
55+
//! .query(&weather_reading.into_query("weather"))
56+
//! .await;
57+
//! assert!(write_result.is_ok(), "Write result was not okay");
58+
//!
59+
//! // Let's see if the data we wrote is there
60+
//! let read_query = Query::raw_read_query("SELECT * FROM weather");
61+
//!
62+
//! let read_result = client.query(&read_query).await;
63+
//! assert!(read_result.is_ok(), "Read result was not ok");
64+
//! println!("{}", read_result.unwrap());
4565
//! }
46-
//!
47-
//! // Let's write some data into a measurement called `weather`
48-
//! let weather_reading = WeatherReading {
49-
//! time: Timestamp::Hours(1).into(),
50-
//! humidity: 30,
51-
//! wind_direction: String::from("north"),
52-
//! };
53-
//!
54-
//! let write_result = client
55-
//! .query(&weather_reading.into_query("weather"))
56-
//! .await;
57-
//! assert!(write_result.is_ok(), "Write result was not okay");
58-
//!
59-
//! // Let's see if the data we wrote is there
60-
//! let read_query = Query::raw_read_query("SELECT * FROM weather");
61-
//!
62-
//! let read_result = client.query(&read_query).await;
63-
//! assert!(read_result.is_ok(), "Read result was not ok");
64-
//! println!("{}", read_result.unwrap());
6566
//! ```
6667
//!
6768
//! For further examples, check out the Integration Tests in `tests/integration_tests.rs`

0 commit comments

Comments
 (0)