From d4789e7a921dd9577436a2bfd31ab218fc167871 Mon Sep 17 00:00:00 2001 From: Barak Bar Orion Date: Tue, 10 Dec 2024 14:12:45 +0200 Subject: [PATCH] Update version on readme Fix clippy warnings fix read only query builder --- README.md | 14 +++++++------- src/client/blocking.rs | 7 ++++--- src/graph/asynchronous.rs | 2 +- src/graph/blocking.rs | 2 +- src/graph/query_builder.rs | 17 +++++++++-------- src/response/index.rs | 1 - src/response/lazy_result_set.rs | 2 +- 7 files changed, 23 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 87ed996..40d24f5 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Just add it to your `Cargo.toml`, like so: ```toml -falkordb = { version = "0.1.9" } +falkordb = { version = "0.1.10" } ``` ### Run FalkorDB instance @@ -69,7 +69,7 @@ This client supports nonblocking API using the [`tokio`](https://tokio.rs/) runt It can be enabled like so: ```toml -falkordb = { version = "0.1.9", features = ["tokio"] } +falkordb = { version = "0.1.10", features = ["tokio"] } ``` Currently, this API requires running within a [ @@ -123,21 +123,21 @@ when using tokio: `"tokio-rustls"`/`"tokio-native-tls"`). For Rustls: ```toml -falkordb = { version = "0.1.9", features = ["rustls"] } +falkordb = { version = "0.1.10", features = ["rustls"] } ``` ```toml -falkordb = { version = "0.1.9", features = ["tokio-rustls"] } +falkordb = { version = "0.1.10", features = ["tokio-rustls"] } ``` For Native TLS: ```toml -falkordb = { version = "0.1.9", features = ["native-tls"] } +falkordb = { version = "0.1.10", features = ["native-tls"] } ``` ```toml -falkordb = { version = "0.1.9", features = ["tokio-native-tls"] } +falkordb = { version = "0.1.10", features = ["tokio-native-tls"] } ``` ### Tracing @@ -146,7 +146,7 @@ This crate fully supports instrumentation using the [`tracing`](https://docs.rs/ it, simply, enable the `tracing` feature: ```toml -falkordb = { version = "0.1.9", features = ["tracing"] } +falkordb = { version = "0.1.10", features = ["tracing"] } ``` Note that different functions use different filtration levels, to avoid spamming your tests, be sure to enable the diff --git a/src/client/blocking.rs b/src/client/blocking.rs index 9e28e8b..1958d3b 100644 --- a/src/client/blocking.rs +++ b/src/client/blocking.rs @@ -111,7 +111,8 @@ impl FalkorSyncClient { }) } - /// Get the max number of connections in the client's connection pool + /// + /// Get the max number of connections in the client's connection pool pub fn connection_pool_size(&self) -> u8 { self.inner.connection_pool_size } @@ -138,7 +139,7 @@ impl FalkorSyncClient { /// /// # Arguments /// * `config_Key`: A [`String`] representation of a configuration's key. - /// The config key can also be "*", which will return ALL the configuration options. + /// The config key can also be "*", which will return ALL the configuration options. /// /// # Returns /// A [`HashMap`] comprised of [`String`] keys, and [`ConfigValue`] values. @@ -161,7 +162,7 @@ impl FalkorSyncClient { /// /// # Arguments /// * `config_Key`: A [`String`] representation of a configuration's key. - /// The config key can also be "*", which will return ALL the configuration options. + /// The config key can also be "*", which will return ALL the configuration options. /// * `value`: The new value to set, which is anything that can be converted into a [`ConfigValue`], namely string types and i64. #[cfg_attr( feature = "tracing", diff --git a/src/graph/asynchronous.rs b/src/graph/asynchronous.rs index b2cb010..9610300 100644 --- a/src/graph/asynchronous.rs +++ b/src/graph/asynchronous.rs @@ -163,7 +163,7 @@ impl AsyncGraph { &'a mut self, query_string: &'a str, ) -> QueryBuilder<'a, QueryResult>, &'a str, Self> { - QueryBuilder::new(self, "GRAPH.QUERY_RO", query_string) + QueryBuilder::new(self, "GRAPH.RO_QUERY", query_string) } /// Creates a [`ProcedureQueryBuilder`] for this graph diff --git a/src/graph/blocking.rs b/src/graph/blocking.rs index 9410c83..231eee6 100644 --- a/src/graph/blocking.rs +++ b/src/graph/blocking.rs @@ -157,7 +157,7 @@ impl SyncGraph { &'a mut self, query_string: &'a str, ) -> QueryBuilder<'a, QueryResult>, &'a str, Self> { - QueryBuilder::new(self, "GRAPH.QUERY_RO", query_string) + QueryBuilder::new(self, "GRAPH.RO_QUERY", query_string) } /// Creates a [`ProcedureQueryBuilder`] for this graph diff --git a/src/graph/query_builder.rs b/src/graph/query_builder.rs index 582aba7..9eb8ac1 100644 --- a/src/graph/query_builder.rs +++ b/src/graph/query_builder.rs @@ -82,7 +82,8 @@ impl<'a, Output, T: Display, G: HasGraphSchema> QueryBuilder<'a, Output, T, G> { /// Specify a timeout after which to abort the query /// /// # Arguments - /// * `timeout`: the timeout after which to abort, in ms + /// * `timeout`: the timeout after which the server is allowed to abort or throw this request, + /// in milliseconds, when that happens the server will return a timeout error pub fn with_timeout( self, timeout: i64, @@ -155,7 +156,7 @@ impl<'a, Output, T: Display, G: HasGraphSchema> QueryBuilder<'a, Output, T, G> { } } -impl<'a, Out, T: Display> QueryBuilder<'a, Out, T, SyncGraph> { +impl QueryBuilder<'_, Out, T, SyncGraph> { #[cfg_attr( feature = "tracing", tracing::instrument(name = "Common Query Execution Steps", skip_all, level = "trace") @@ -234,7 +235,7 @@ impl<'a, T: Display> QueryBuilder<'a, QueryResult>, T, AsyncGr } } -impl<'a, T: Display> QueryBuilder<'a, ExecutionPlan, T, SyncGraph> { +impl QueryBuilder<'_, ExecutionPlan, T, SyncGraph> { /// Executes the query, returning an [`ExecutionPlan`] from the data returned pub fn execute(mut self) -> FalkorResult { self.common_execute_steps().and_then(ExecutionPlan::parse) @@ -386,7 +387,7 @@ impl<'a, Out, G: HasGraphSchema> ProcedureQueryBuilder<'a, Out, G> { } } -impl<'a, Out> ProcedureQueryBuilder<'a, Out, SyncGraph> { +impl ProcedureQueryBuilder<'_, Out, SyncGraph> { #[cfg_attr( feature = "tracing", tracing::instrument( @@ -397,7 +398,7 @@ impl<'a, Out> ProcedureQueryBuilder<'a, Out, SyncGraph> { )] fn common_execute_steps(&mut self) -> FalkorResult { let command = match self.readonly { - true => "GRAPH.QUERY_RO", + true => "GRAPH.RO_QUERY", false => "GRAPH.QUERY", }; @@ -431,7 +432,7 @@ impl<'a, Out> ProcedureQueryBuilder<'a, Out, AsyncGraph> { )] async fn common_execute_steps(&mut self) -> FalkorResult { let command = match self.readonly { - true => "GRAPH.QUERY_RO", + true => "GRAPH.RO_QUERY", false => "GRAPH.QUERY", }; @@ -453,7 +454,7 @@ impl<'a, Out> ProcedureQueryBuilder<'a, Out, AsyncGraph> { } } -impl<'a> ProcedureQueryBuilder<'a, QueryResult>, SyncGraph> { +impl ProcedureQueryBuilder<'_, QueryResult>, SyncGraph> { /// Executes the procedure call and return a [`QueryResult`] type containing a result set of [`FalkorIndex`]s /// This functions consumes self #[cfg_attr( @@ -481,7 +482,7 @@ impl<'a> ProcedureQueryBuilder<'a, QueryResult>, AsyncGraph> { } } -impl<'a> ProcedureQueryBuilder<'a, QueryResult>, SyncGraph> { +impl ProcedureQueryBuilder<'_, QueryResult>, SyncGraph> { /// Executes the procedure call and return a [`QueryResult`] type containing a result set of [`Constraint`]s /// This functions consumes self #[cfg_attr( diff --git a/src/response/index.rs b/src/response/index.rs index 840db66..c0ef525 100644 --- a/src/response/index.rs +++ b/src/response/index.rs @@ -50,7 +50,6 @@ fn parse_string_array( vector .into_iter() .map(FalkorValue::into_string) - .into_iter() .collect::, FalkorDBError>>() }) } diff --git a/src/response/lazy_result_set.rs b/src/response/lazy_result_set.rs index 1868b06..8fa5054 100644 --- a/src/response/lazy_result_set.rs +++ b/src/response/lazy_result_set.rs @@ -36,7 +36,7 @@ impl<'a> LazyResultSet<'a> { } } -impl<'a> Iterator for LazyResultSet<'a> { +impl Iterator for LazyResultSet<'_> { type Item = Vec; #[cfg_attr(