Skip to content

Commit a3e4a2d

Browse files
authored
influxdb/src/query: Send uints as influxdb unsigned integers (u suffix instead of i) (#113)
1 parent e6326d8 commit a3e4a2d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

influxdb/src/query/line_proto_term.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl LineProtoTerm<'_> {
4343
.to_string(),
4444
Float(v) => v.to_string(),
4545
SignedInteger(v) => format!("{}i", v),
46-
UnsignedInteger(v) => format!("{}i", v),
46+
UnsignedInteger(v) => format!("{}u", v),
4747
Text(v) => format!(r#""{}""#, Self::escape_any(v, &*QUOTES_SLASHES)),
4848
}
4949
}

influxdb/src/query/write_query.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,13 @@ mod tests {
264264
.into_query("weather".to_string())
265265
.add_field("temperature", 82)
266266
.add_field("wind_strength", 3.7)
267+
.add_field("temperature_unsigned", 82u64)
267268
.build();
268269

269270
assert!(query.is_ok(), "Query was empty");
270271
assert_eq!(
271272
query.unwrap(),
272-
"weather temperature=82i,wind_strength=3.7 11"
273+
"weather temperature=82i,wind_strength=3.7,temperature_unsigned=82u 11"
273274
);
274275
}
275276

@@ -282,7 +283,7 @@ mod tests {
282283
.build();
283284

284285
assert!(query.is_ok(), "Query was empty");
285-
assert_eq!(query.unwrap(), "weather temperature=82i 11");
286+
assert_eq!(query.unwrap(), "weather temperature=82u 11");
286287
}
287288

288289
#[test]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy