You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added methods to query and post strongly typed points using attributes (#99)
* Added methods to query and post strongly typed points using attributes
* Extend readme with further property types
Co-authored-by: Titusz Ban <titusz.ban@trayport.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
## v0.21.0 [08/25/2020]
2
+
3
+
### Release Notes
4
+
This version introduces methods to query and post strongly typed points using attributes. Thanks to @tituszban for adding the attribute support. Refer to [Readme.md](https://github.com/AdysTech/InfluxDB.Client.Net/blob/master/README.md) for examples.
5
+
6
+
1
7
## v0.20.0 [08/11/2020]
2
8
3
9
### Release Notes
@@ -268,4 +274,4 @@ Added the functionality to query for existing data from InfluxDB. Also unknown l
268
274
269
275
### Bugfixes
270
276
271
-
-[#3](https://github.com/AdysTech/InfluxDB.Client.Net/pull/3): Double to str conversion fix, Thanks to @spamik
277
+
-[#3](https://github.com/AdysTech/InfluxDB.Client.Net/pull/3): Double to str conversion fix, Thanks to @spamik
Copy file name to clipboardExpand all lines: README.md
+68Lines changed: 68 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,62 @@ var r = await client.PostPointAsync(dbName, valMixed);
93
93
94
94
A collection of points can be posted using `await client.PostPointsAsync (dbName, points)`, where `points` can be collection of different types of `InfluxDatapoint`
This supports all types `InfluxValueField` supports. Additionally it supports tags other than strings, as long as they can be converted to string.
147
+
148
+
The parameter that has `InfluxDBRetentionPolicy` applied to it can be an `IInfluxRetentionPolicy` alternatively it will be treated as a string and will be used as the name of the retention policy.
149
+
150
+
A collection of points can be posted using `await client.PostPointsAsync<T>(dbName, points)`, where `points` can be collection of arbitrary type `T` with appropriate attributes
151
+
96
152
#### Query for data points
97
153
98
154
```Csharp
@@ -107,6 +163,18 @@ Second example above will provide multiple series objects, and allows to get dat
107
163
108
164
The last example above makes InfluxDB to split the selected points (100 limited by `limit` clause) to multiple series, each having 10 points as given by `chunk` size.
109
165
166
+
167
+
#### Query for strongly typed data points
168
+
169
+
```Csharp
170
+
varr=awaitclient.QueryMultiSeriesAsync<YourPoint>(dbName, $"select * from {measurementName}");
171
+
```
172
+
173
+
`QueryMultiSeriesAsync<T>` method returns `List<InfluxSeries<T>>`, `InfluxSeries<T>` behaves similar to `InfluxSeries` except Entries are not dynamic but strongly typed as T. It uses the same attributes as used for writing the points to match the fields and tags to the matching properties. If a matching property can't be found, the field is discarded. If a property doesn't have a matching field, it's left empty.
174
+
175
+
It supports multiple chuncks similarly to `QueryMultiSeriesAsync`.
176
+
177
+
110
178
#### Retention Policies
111
179
112
180
This library uses a cutsom .Net object to represent the Influx Retention Policy. The `Duration` concept is nicely wraped in `TimeSpan`, so it can be easily manipulated using .Net code. It also supports `ShardDuration` concept introduced in recent versions of InfluxDB.
0 commit comments