Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Removed
- `<dyn Query>::raw_read_query`, deprecated in 0.5.0, was removed

## [0.7.2] - 2024-02-14

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ resolver = "2"

[workspace.package]
authors = ["Gero Gerke <[email protected]>", "Dominic <[email protected]>"]
edition = "2018"
edition = "2021"
rust-version = "1.67.1"
license = "MIT"
repository = "https://github.com/influxdb-rs/influxdb-rust"
Expand Down
5 changes: 5 additions & 0 deletions influxdb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ repository.workspace = true
[lints]
workspace = true

[[test]]
name = "derive_integration_tests"
path = "tests/derive_integration_tests.rs"
required-features = ["chrono"]

[dependencies]
chrono = { version = "0.4.23", features = ["serde"], default-features = false, optional = true }
futures-util = "0.3.17"
Expand Down
4 changes: 2 additions & 2 deletions influxdb/src/integrations/serde_integration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! `name`, InfluxDB provides alongside query results.
//!
//! ```rust,no_run
//! use influxdb::{Client, Query};
//! use influxdb::{Client, Query as _, ReadQuery};
//! use serde_derive::Deserialize;
//!
//! #[derive(Deserialize)]
Expand All @@ -24,7 +24,7 @@
//! # #[tokio::main]
//! # async fn main() -> Result<(), influxdb::Error> {
//! let client = Client::new("http://localhost:8086", "test");
//! let query = Query::raw_read_query(
//! let query = ReadQuery::new(
//! "SELECT temperature FROM /weather_[a-z]*$/ WHERE time > now() - 1m ORDER BY DESC",
//! );
//! let mut db_result = client.json_query(query).await?;
Expand Down
26 changes: 3 additions & 23 deletions influxdb/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! # Examples
//!
//! ```rust
//! use influxdb::{Query, Timestamp};
//! use influxdb::{ReadQuery, Query as _, Timestamp};
//! use influxdb::InfluxDbWriteable;
//!
//! let write_query = Timestamp::Nanoseconds(0).into_query("measurement")
Expand All @@ -14,7 +14,7 @@
//!
//! assert!(write_query.is_ok());
//!
//! let read_query = Query::raw_read_query("SELECT * FROM weather")
//! let read_query = ReadQuery::new("SELECT * FROM weather")
//! .build();
//!
//! assert!(read_query.is_ok());
Expand All @@ -26,7 +26,7 @@ pub mod read_query;
pub mod write_query;
use std::fmt;

use crate::{Error, ReadQuery, WriteQuery};
use crate::{Error, WriteQuery};
use consts::{
MILLIS_PER_SECOND, MINUTES_PER_HOUR, NANOS_PER_MICRO, NANOS_PER_MILLI, SECONDS_PER_MINUTE,
};
Expand Down Expand Up @@ -195,25 +195,6 @@ impl InfluxDbWriteable for Timestamp {
}
}

impl dyn Query {
/// Returns a [`ReadQuery`](crate::ReadQuery) builder.
///
/// # Examples
///
/// ```rust
/// use influxdb::Query;
///
/// Query::raw_read_query("SELECT * FROM weather"); // Is of type [`ReadQuery`](crate::ReadQuery)
/// ```
#[deprecated(since = "0.5.0", note = "Use ReadQuery::new instead")]
pub fn raw_read_query<S>(read_query: S) -> ReadQuery
where
S: Into<String>,
{
ReadQuery::new(read_query)
}
}

#[derive(Debug)]
#[doc(hidden)]
pub struct ValidQuery(String);
Expand Down Expand Up @@ -255,7 +236,6 @@ mod tests {
MILLIS_PER_SECOND, MINUTES_PER_HOUR, NANOS_PER_MICRO, NANOS_PER_MILLI, SECONDS_PER_MINUTE,
};
use crate::query::{Timestamp, ValidQuery};
use std::convert::TryInto;
#[test]
fn test_equality_str() {
assert_eq!(ValidQuery::from("hello"), "hello");
Expand Down
7 changes: 3 additions & 4 deletions influxdb/src/query/read_query.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//! Read Query Builder returned by Query::raw_read_query
//!
//! Can only be instantiated by using Query::raw_read_query
//! Read Query Builder

use crate::query::{QueryType, ValidQuery};
use crate::{Error, Query};
Expand Down Expand Up @@ -49,7 +47,8 @@ impl Query for ReadQuery {

#[cfg(test)]
mod tests {
use crate::query::{Query, QueryType, ReadQuery};
use super::ReadQuery;
use crate::query::{Query, QueryType};

#[test]
fn test_read_builder_single_query() {
Expand Down
1 change: 0 additions & 1 deletion influxdb_derive/src/writeable.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use proc_macro2::TokenStream;
use quote::{format_ident, quote};
use std::convert::TryFrom;
use syn::{
parse::{Parse, ParseStream},
punctuated::Punctuated,
Expand Down
Loading