From f7565bd3e53a22456fab403dda71345116976772 Mon Sep 17 00:00:00 2001 From: Gonzalo Busto Musi Date: Sun, 23 Apr 2023 14:27:47 +0200 Subject: [PATCH 01/11] Added 'like' operator. Removed unneeded whitespaces on queries. --- canyon_crud/src/query_elements/operators.rs | 39 ++++++++++++++----- .../src/query_elements/query_builder.rs | 18 +++------ tests/crud/querybuilder_operations.rs | 4 +- 3 files changed, 37 insertions(+), 24 deletions(-) diff --git a/canyon_crud/src/query_elements/operators.rs b/canyon_crud/src/query_elements/operators.rs index 7a91e7ef..53cf0b2e 100644 --- a/canyon_crud/src/query_elements/operators.rs +++ b/canyon_crud/src/query_elements/operators.rs @@ -1,5 +1,5 @@ pub trait Operator { - fn as_str(&self) -> &'static str; + fn as_str(&self, placeholder_counter: usize) -> String; } /// Enumerated type for represent the comparison operations @@ -16,17 +16,38 @@ pub enum Comp { /// Operator "<" less than value Lt, /// Operator "=<" less or equals than value - LtEq, + LtEq } + impl Operator for Comp { - fn as_str(&self) -> &'static str { + fn as_str(&self, placeholder_counter: usize) -> String { + match *self { + Self::Eq => format!(" = ${placeholder_counter}"), + Self::Neq => format!(" <> ${placeholder_counter}"), + Self::Gt => format!(" > ${placeholder_counter}"), + Self::GtEq => format!(" >= ${placeholder_counter}"), + Self::Lt => format!(" < ${placeholder_counter}"), + Self::LtEq => format!(" <= ${placeholder_counter}") + } + } +} + +pub enum Like { + /// Operator "LIKE" as '%pattern%' + Full, + /// Operator "LIKE" as '%pattern' + Left, + /// Operator "LIKE" as 'pattern%' + Right +} + + +impl Operator for Like { + fn as_str(&self, placeholder_counter: usize) -> String { match *self { - Self::Eq => " = ", - Self::Neq => " <> ", - Self::Gt => " > ", - Self::GtEq => " >= ", - Self::Lt => " < ", - Self::LtEq => " <= ", + Like::Full => format!(" LIKE CONCAT('%', ${placeholder_counter} ,'%') "), + Like::Left => format!(" LIKE CONCAT('%', ${placeholder_counter}) "), + Like::Right => format!(" LIKE CONCAT(${placeholder_counter} ,'%') "), } } } diff --git a/canyon_crud/src/query_elements/query_builder.rs b/canyon_crud/src/query_elements/query_builder.rs index 92146542..cbddedc5 100644 --- a/canyon_crud/src/query_elements/query_builder.rs +++ b/canyon_crud/src/query_elements/query_builder.rs @@ -182,9 +182,7 @@ where let where_ = String::from(" WHERE ") + column_name - + op.as_str() - + "$" - + &(self.query.params.len() + 1).to_string(); + + &op.as_str(self.query.params.len() + 1); self.query.sql.push_str(&where_); self.query.params.push(value); @@ -195,10 +193,7 @@ where let and_ = String::from(" AND ") + column_name - + op.as_str() - + "$" - + &(self.query.params.len() + 1).to_string() - + " "; + + &op.as_str(self.query.params.len() + 1); self.query.sql.push_str(&and_); self.query.params.push(value); @@ -209,10 +204,7 @@ where let and_ = String::from(" OR ") + column_name - + op.as_str() - + "$" - + &(self.query.params.len() + 1).to_string() - + " "; + + &op.as_str(self.query.params.len() + 1); self.query.sql.push_str(&and_); self.query.params.push(value); @@ -246,7 +238,7 @@ where self.query.params.push(qp) }); - self.query.sql.push_str(") "); + self.query.sql.push_str(")"); } fn or_values_in(&mut self, r#or: Z, values: &'a [Q]) @@ -277,7 +269,7 @@ where self.query.params.push(qp) }); - self.query.sql.push_str(") "); + self.query.sql.push_str(")"); } #[inline] diff --git a/tests/crud/querybuilder_operations.rs b/tests/crud/querybuilder_operations.rs index 1c853161..a9ea40fb 100644 --- a/tests/crud/querybuilder_operations.rs +++ b/tests/crud/querybuilder_operations.rs @@ -34,7 +34,7 @@ fn test_generated_sql_by_the_select_querybuilder() { // generated SQL by the SelectQueryBuilder is the spected assert_eq!( select_with_joins.read_sql(), - "SELECT * FROM league INNER JOIN tournament ON league.id = tournament.league_id LEFT JOIN team ON tournament.id = player.tournament_id WHERE id > $1 AND name = $2 AND name IN ($2, $3) " + "SELECT * FROM league INNER JOIN tournament ON league.id = tournament.league_id LEFT JOIN team ON tournament.id = player.tournament_id WHERE id > $1 AND name = $2 AND name IN ($2, $3)" ) } @@ -239,7 +239,7 @@ fn test_or_clause_with_in_constraint() { assert_eq!( l.read_sql(), - "SELECT * FROM league WHERE name = $1 OR id IN ($1, $2, $3) " + "SELECT * FROM league WHERE name = $1 OR id IN ($1, $2, $3)" ) } From 8795fa687ec45adeb2a6d256a479292542e38f47 Mon Sep 17 00:00:00 2001 From: "Gonzalo Busto Musiorigin git@github.com:username/repo.git" Date: Sun, 23 Apr 2023 20:29:11 +0200 Subject: [PATCH 02/11] Fixes for like operator. Added tests for like operators. --- canyon_crud/src/query_elements/operators.rs | 15 +-- .../src/query_elements/query_builder.rs | 13 +-- tests/crud/querybuilder_operations.rs | 92 ++++++++++++++++++- 3 files changed, 103 insertions(+), 17 deletions(-) diff --git a/canyon_crud/src/query_elements/operators.rs b/canyon_crud/src/query_elements/operators.rs index 53cf0b2e..30637bad 100644 --- a/canyon_crud/src/query_elements/operators.rs +++ b/canyon_crud/src/query_elements/operators.rs @@ -16,7 +16,7 @@ pub enum Comp { /// Operator "<" less than value Lt, /// Operator "=<" less or equals than value - LtEq + LtEq, } impl Operator for Comp { @@ -27,7 +27,7 @@ impl Operator for Comp { Self::Gt => format!(" > ${placeholder_counter}"), Self::GtEq => format!(" >= ${placeholder_counter}"), Self::Lt => format!(" < ${placeholder_counter}"), - Self::LtEq => format!(" <= ${placeholder_counter}") + Self::LtEq => format!(" <= ${placeholder_counter}"), } } } @@ -38,16 +38,17 @@ pub enum Like { /// Operator "LIKE" as '%pattern' Left, /// Operator "LIKE" as 'pattern%' - Right + Right, } - impl Operator for Like { fn as_str(&self, placeholder_counter: usize) -> String { match *self { - Like::Full => format!(" LIKE CONCAT('%', ${placeholder_counter} ,'%') "), - Like::Left => format!(" LIKE CONCAT('%', ${placeholder_counter}) "), - Like::Right => format!(" LIKE CONCAT(${placeholder_counter} ,'%') "), + Like::Full => { + format!(" LIKE CONCAT('%', CAST(${placeholder_counter} AS VARCHAR) ,'%')") + } + Like::Left => format!(" LIKE CONCAT('%', CAST(${placeholder_counter} AS VARCHAR))"), + Like::Right => format!(" LIKE CONCAT(CAST(${placeholder_counter} AS VARCHAR) ,'%')"), } } } diff --git a/canyon_crud/src/query_elements/query_builder.rs b/canyon_crud/src/query_elements/query_builder.rs index cbddedc5..ddcde0fd 100644 --- a/canyon_crud/src/query_elements/query_builder.rs +++ b/canyon_crud/src/query_elements/query_builder.rs @@ -180,9 +180,8 @@ where pub fn r#where>(&mut self, r#where: Z, op: impl Operator) { let (column_name, value) = r#where.value(); - let where_ = String::from(" WHERE ") - + column_name - + &op.as_str(self.query.params.len() + 1); + let where_ = + String::from(" WHERE ") + column_name + &op.as_str(self.query.params.len() + 1); self.query.sql.push_str(&where_); self.query.params.push(value); @@ -191,9 +190,7 @@ where pub fn and>(&mut self, r#and: Z, op: impl Operator) { let (column_name, value) = r#and.value(); - let and_ = String::from(" AND ") - + column_name - + &op.as_str(self.query.params.len() + 1); + let and_ = String::from(" AND ") + column_name + &op.as_str(self.query.params.len() + 1); self.query.sql.push_str(&and_); self.query.params.push(value); @@ -202,9 +199,7 @@ where pub fn or>(&mut self, r#and: Z, op: impl Operator) { let (column_name, value) = r#and.value(); - let and_ = String::from(" OR ") - + column_name - + &op.as_str(self.query.params.len() + 1); + let and_ = String::from(" OR ") + column_name + &op.as_str(self.query.params.len() + 1); self.query.sql.push_str(&and_); self.query.params.push(value); diff --git a/tests/crud/querybuilder_operations.rs b/tests/crud/querybuilder_operations.rs index a9ea40fb..4bc205f6 100644 --- a/tests/crud/querybuilder_operations.rs +++ b/tests/crud/querybuilder_operations.rs @@ -6,7 +6,7 @@ /// use canyon_sql::{ crud::CrudOperations, - query::{operators::Comp, ops::QueryBuilder}, + query::{operators::Comp, operators::Like, ops::QueryBuilder}, }; #[cfg(feature = "mssql")] @@ -59,6 +59,96 @@ fn test_crud_find_with_querybuilder() { assert_eq!(league_idx_0.region, "KOREA"); } +/// Builds a new SQL statement for retrieves entities of the `T` type, filtered +/// with the parameters that modifies the base SQL to SELECT * FROM +#[cfg(feature = "postgres")] +#[canyon_sql::macros::canyon_tokio_test] +fn test_crud_find_with_querybuilder_and_fulllike() { + // Find all the leagues with "LC" in their name + let mut filtered_leagues_result = League::select_query(); + filtered_leagues_result.r#where(LeagueFieldValue::name(&"LC"), Like::Full); + + assert_eq!( + filtered_leagues_result.read_sql(), + "SELECT * FROM league WHERE name LIKE CONCAT('%', CAST($1 AS VARCHAR) ,'%')" + ) +} + +/// Builds a new SQL statement for retrieves entities of the `T` type, filtered +/// with the parameters that modifies the base SQL to SELECT * FROM +#[cfg(feature = "mssql")] +#[canyon_sql::macros::canyon_tokio_test] +fn test_crud_find_with_querybuilder_and_fulllike_datasource() { + // Find all the leagues with "LC" in their name + let mut filtered_leagues_result = League::select_query_datasource(SQL_SERVER_DS); + filtered_leagues_result.r#where(LeagueFieldValue::name(&"LC"), Like::Full); + + assert_eq!( + filtered_leagues_result.read_sql(), + "SELECT * FROM league WHERE name LIKE CONCAT('%', CAST($1 AS VARCHAR) ,'%')" + ) +} + +/// Builds a new SQL statement for retrieves entities of the `T` type, filtered +/// with the parameters that modifies the base SQL to SELECT * FROM +#[cfg(feature = "postgres")] +#[canyon_sql::macros::canyon_tokio_test] +fn test_crud_find_with_querybuilder_and_leftlike() { + // Find all the leagues whose name ends with "CK" + let mut filtered_leagues_result = League::select_query(); + filtered_leagues_result.r#where(LeagueFieldValue::name(&"CK"), Like::Left); + + assert_eq!( + filtered_leagues_result.read_sql(), + "SELECT * FROM league WHERE name LIKE CONCAT('%', CAST($1 AS VARCHAR))" + ) +} + +/// Builds a new SQL statement for retrieves entities of the `T` type, filtered +/// with the parameters that modifies the base SQL to SELECT * FROM +#[cfg(feature = "mssql")] +#[canyon_sql::macros::canyon_tokio_test] +fn test_crud_find_with_querybuilder_and_leftlike_datasource() { + // Find all the leagues whose name ends with "CK" + let mut filtered_leagues_result = League::select_query(); + filtered_leagues_result.r#where(LeagueFieldValue::name(&"CK"), Like::Left); + + assert_eq!( + filtered_leagues_result.read_sql(), + "SELECT * FROM league WHERE name LIKE CONCAT('%', CAST($1 AS VARCHAR))" + ) +} + +/// Builds a new SQL statement for retrieves entities of the `T` type, filtered +/// with the parameters that modifies the base SQL to SELECT * FROM +#[cfg(feature = "postgres")] +#[canyon_sql::macros::canyon_tokio_test] +fn test_crud_find_with_querybuilder_and_rightlike() { + // Find all the leagues whose name starts with "LC" + let mut filtered_leagues_result = League::select_query(); + filtered_leagues_result.r#where(LeagueFieldValue::name(&"LC"), Like::Right); + + assert_eq!( + filtered_leagues_result.read_sql(), + "SELECT * FROM league WHERE name LIKE CONCAT(CAST($1 AS VARCHAR) ,'%')" + ) +} + +/// Builds a new SQL statement for retrieves entities of the `T` type, filtered +/// with the parameters that modifies the base SQL to SELECT * FROM +#[cfg(feature = "mssql")] +#[canyon_sql::macros::canyon_tokio_test] +fn test_crud_find_with_querybuilder_and_rightlike_datasource() { + // Find all the leagues whose name starts with "LC" + let mut filtered_leagues_result = League::select_query_datasource(SQL_SERVER_DS); + filtered_leagues_result.r#where(LeagueFieldValue::name(&"LC"), Like::Right); + + assert_eq!( + filtered_leagues_result.read_sql(), + "SELECT * FROM league WHERE name LIKE CONCAT(CAST($1 AS VARCHAR) ,'%')" + ) +} + /// Same than the above but with the specified datasource #[cfg(feature = "mssql")] #[canyon_sql::macros::canyon_tokio_test] From cd933123ba51eb284dc8b9106bb250241a1d98df Mon Sep 17 00:00:00 2001 From: "Gonzalo Busto Musiorigin git@github.com:username/repo.git" Date: Sun, 23 Apr 2023 20:30:26 +0200 Subject: [PATCH 03/11] Upgrade to v0.4.1 --- Cargo.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 17322b31..402a49a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,11 +33,11 @@ tokio-postgres = { workspace = true, optional = true } tiberius = { workspace = true, optional = true } [workspace.dependencies] -canyon_crud = { version = "0.4.0", path = "canyon_crud" } -canyon_connection = { version = "0.4.0", path = "canyon_connection" } -canyon_entities = { version = "0.4.0", path = "canyon_entities" } -canyon_migrations = { version = "0.4.0", path = "canyon_migrations"} -canyon_macros = { version = "0.4.0", path = "canyon_macros" } +canyon_crud = { version = "0.4.1", path = "canyon_crud" } +canyon_connection = { version = "0.4.1", path = "canyon_connection" } +canyon_entities = { version = "0.4.1", path = "canyon_entities" } +canyon_migrations = { version = "0.4.1", path = "canyon_migrations"} +canyon_macros = { version = "0.4.1", path = "canyon_macros" } tokio = { version = "1.27.0", features = ["full"] } tokio-util = { version = "0.7.4", features = ["compat"] } @@ -61,7 +61,7 @@ quote = "1.0.9" proc-macro2 = "1.0.27" [workspace.package] -version = "0.4.0" +version = "0.4.1" edition = "2021" authors = ["Alex Vergara, Gonzalo Busto Musi"] documentation = "https://zerodaycode.github.io/canyon-book/" From 02d5b362e9313a1547646a5c17f7b20521547ec1 Mon Sep 17 00:00:00 2001 From: "Gonzalo Busto Musiorigin git@github.com:username/repo.git" Date: Sun, 23 Apr 2023 20:49:10 +0200 Subject: [PATCH 04/11] Fix clippy warnings --- canyon_crud/src/query_elements/query_builder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/canyon_crud/src/query_elements/query_builder.rs b/canyon_crud/src/query_elements/query_builder.rs index ddcde0fd..e6987d47 100644 --- a/canyon_crud/src/query_elements/query_builder.rs +++ b/canyon_crud/src/query_elements/query_builder.rs @@ -233,7 +233,7 @@ where self.query.params.push(qp) }); - self.query.sql.push_str(")"); + self.query.sql.push(')') } fn or_values_in(&mut self, r#or: Z, values: &'a [Q]) @@ -264,7 +264,7 @@ where self.query.params.push(qp) }); - self.query.sql.push_str(")"); + self.query.sql.push(')') } #[inline] From 86a0ce7d5a67e4f256fbc34d431962818a3124a6 Mon Sep 17 00:00:00 2001 From: Gonzalo Busto Musi Date: Tue, 2 May 2023 20:07:46 +0200 Subject: [PATCH 05/11] Fix for unspecified features --- src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 1d2e3375..faea258c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,9 +6,11 @@ extern crate canyon_connection; extern crate canyon_crud; extern crate canyon_macros; -extern crate canyon_migrations; +#[cfg(feature = "migrations")] extern crate canyon_migrations; + /// Reexported elements to the root of the public API +#[cfg(feature = "migrations")] pub mod migrations { pub use canyon_migrations::migrations::{handler, processor}; } From 77c586d9b4ef3caa9c2e151ea52d1e91ad2b465a Mon Sep 17 00:00:00 2001 From: Gonzalo Busto Musi Date: Tue, 2 May 2023 20:22:07 +0200 Subject: [PATCH 06/11] cargo fmt and clippy --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index faea258c..d89f79b2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,8 +6,8 @@ extern crate canyon_connection; extern crate canyon_crud; extern crate canyon_macros; -#[cfg(feature = "migrations")] extern crate canyon_migrations; - +#[cfg(feature = "migrations")] +extern crate canyon_migrations; /// Reexported elements to the root of the public API #[cfg(feature = "migrations")] From dc18c00a3ff65e8dcd82d18f0be8654af83c5b5d Mon Sep 17 00:00:00 2001 From: Gonzalo Busto Musi Date: Tue, 2 May 2023 20:29:17 +0200 Subject: [PATCH 07/11] Upgrade to v0.4.2 and added entry for the version in changelog --- CHANGELOG.md | 8 +++++++- Cargo.toml | 12 ++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85a96308..9bdad1dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,13 @@ Year format is defined as: `YYYY-m-d` ## [Unreleased] -## [0.4.1 - 2023 - 04 - 23 +## [0.4.2 - 2023 - 05 - 02] + +### Bugfix + +Fixed a bug related to migrations that prevented compiling if features were not specified. + +## [0.4.1 - 2023 - 04 - 23] ### Feature diff --git a/Cargo.toml b/Cargo.toml index 402a49a7..341a28dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,11 +33,11 @@ tokio-postgres = { workspace = true, optional = true } tiberius = { workspace = true, optional = true } [workspace.dependencies] -canyon_crud = { version = "0.4.1", path = "canyon_crud" } -canyon_connection = { version = "0.4.1", path = "canyon_connection" } -canyon_entities = { version = "0.4.1", path = "canyon_entities" } -canyon_migrations = { version = "0.4.1", path = "canyon_migrations"} -canyon_macros = { version = "0.4.1", path = "canyon_macros" } +canyon_crud = { version = "0.4.2", path = "canyon_crud" } +canyon_connection = { version = "0.4.2", path = "canyon_connection" } +canyon_entities = { version = "0.4.2", path = "canyon_entities" } +canyon_migrations = { version = "0.4.2", path = "canyon_migrations"} +canyon_macros = { version = "0.4.2", path = "canyon_macros" } tokio = { version = "1.27.0", features = ["full"] } tokio-util = { version = "0.7.4", features = ["compat"] } @@ -61,7 +61,7 @@ quote = "1.0.9" proc-macro2 = "1.0.27" [workspace.package] -version = "0.4.1" +version = "0.4.2" edition = "2021" authors = ["Alex Vergara, Gonzalo Busto Musi"] documentation = "https://zerodaycode.github.io/canyon-book/" From e7d4e3da840ec1153bb0c047ed3e900b53350ec7 Mon Sep 17 00:00:00 2001 From: Gonzalo Busto Musi Date: Wed, 3 May 2023 10:41:33 +0200 Subject: [PATCH 08/11] Correction of a comment --- bash_aliases.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_aliases.sh b/bash_aliases.sh index aee09cd7..64b40415 100644 --- a/bash_aliases.sh +++ b/bash_aliases.sh @@ -7,7 +7,7 @@ # In order to run the script, simply type `$ . ./bash_aliases.sh` from the root of the project. # (refreshing the current terminal session could be required) -# Executes the docker compose script to wake up the postgres container +# Executes the docker compose script to wake up the containers alias DockerUp='docker-compose -f ./docker/docker-compose.yml up' # Shutdown the postgres container alias DockerDown='docker-compose -f ./docker/docker-compose.yml down' From 5e723de4d43c4b55ec9588b4c65bfff64826806a Mon Sep 17 00:00:00 2001 From: Gonzalo Busto Musi Date: Wed, 3 May 2023 10:42:32 +0200 Subject: [PATCH 09/11] Test fix --- tests/migrations/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/migrations/mod.rs b/tests/migrations/mod.rs index 47f82566..5b37d999 100644 --- a/tests/migrations/mod.rs +++ b/tests/migrations/mod.rs @@ -1,11 +1,11 @@ #![allow(unused_imports)] ///! Integration tests for the migrations feature of `Canyon-SQL` -use canyon_sql::{crud::Transaction, migrations::handler::Migrations}; - +use canyon_sql::crud::Transaction; +#[cfg(feature = "migrations")] use canyon_sql::migrations::handler::Migrations; use crate::constants; /// Brings the information of the `PostgreSQL` requested schema -#[cfg(feature = "postgres")] +#[cfg(all(feature = "postgres",feature = "migrations"))] #[canyon_sql::macros::canyon_tokio_test] fn test_migrations_postgresql_status_query() { let results = Migrations::query(constants::FETCH_PUBLIC_SCHEMA, [], constants::PSQL_DS).await; From 01b29ea71cdfbbc084e781ad338d0c7599ad02e7 Mon Sep 17 00:00:00 2001 From: Gonzalo Busto Musi Date: Wed, 3 May 2023 10:44:34 +0200 Subject: [PATCH 10/11] Cargo fmt and clippy --- tests/migrations/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/migrations/mod.rs b/tests/migrations/mod.rs index 5b37d999..01260fb3 100644 --- a/tests/migrations/mod.rs +++ b/tests/migrations/mod.rs @@ -1,11 +1,12 @@ #![allow(unused_imports)] +use crate::constants; ///! Integration tests for the migrations feature of `Canyon-SQL` use canyon_sql::crud::Transaction; -#[cfg(feature = "migrations")] use canyon_sql::migrations::handler::Migrations; -use crate::constants; +#[cfg(feature = "migrations")] +use canyon_sql::migrations::handler::Migrations; /// Brings the information of the `PostgreSQL` requested schema -#[cfg(all(feature = "postgres",feature = "migrations"))] +#[cfg(all(feature = "postgres", feature = "migrations"))] #[canyon_sql::macros::canyon_tokio_test] fn test_migrations_postgresql_status_query() { let results = Migrations::query(constants::FETCH_PUBLIC_SCHEMA, [], constants::PSQL_DS).await; From f0739fd88f5fedd290b2dc16b5e8a1f221408551 Mon Sep 17 00:00:00 2001 From: Gonzalo Busto Musi Date: Wed, 3 May 2023 10:59:23 +0200 Subject: [PATCH 11/11] Fix unused import clippy --- tests/constants.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/constants.rs b/tests/constants.rs index 1c9c8044..dd3a268b 100644 --- a/tests/constants.rs +++ b/tests/constants.rs @@ -5,7 +5,7 @@ pub const PSQL_DS: &str = "postgres_docker"; #[cfg(feature = "mssql")] pub const SQL_SERVER_DS: &str = "sqlserver_docker"; -#[cfg(feature = "postgres")] +#[cfg(all(feature = "postgres", feature = "migrations"))] pub static FETCH_PUBLIC_SCHEMA: &str = "SELECT gi.table_name,