diff --git a/examples/sqlx-mysql/Cargo.toml b/examples/sqlx-mysql/Cargo.toml index 27c52348..a9e1d9ae 100644 --- a/examples/sqlx-mysql/Cargo.toml +++ b/examples/sqlx-mysql/Cargo.toml @@ -7,7 +7,6 @@ publish = false [dependencies] async-std = { version = "^1.9", features = [ "attributes" ] } sea-orm = { path = "../../", features = [ "sqlx-mysql", "runtime-async-std-native-tls", "debug-print", "with-json", "macros" ], default-features = false } -# sea-query = { path = "../../../sea-query" } strum = { version = "^0.20", features = [ "derive" ] } serde_json = { version = "^1" } futures = { version = "^0.3" } diff --git a/src/database/connection.rs b/src/database/connection.rs index a5d72dd5..b3f4172e 100644 --- a/src/database/connection.rs +++ b/src/database/connection.rs @@ -1,4 +1,4 @@ -use crate::{ExecErr, ExecResult, MockDatabaseConnection, QueryErr, QueryResult, Statement}; +use crate::{ExecErr, ExecResult, QueryErr, QueryResult, Statement}; use sea_query::{ DeleteStatement, InsertStatement, MysqlQueryBuilder, PostgresQueryBuilder, QueryStatementBuilder, SelectStatement, UpdateStatement, @@ -92,9 +92,9 @@ impl DatabaseConnection { } } - pub fn as_mock_connection(&self) -> &MockDatabaseConnection { + #[cfg(feature = "mock")] + pub fn as_mock_connection(&self) -> &crate::MockDatabaseConnection { match self { - #[cfg(feature = "mock")] DatabaseConnection::MockDatabaseConnection(mock_conn) => mock_conn, _ => panic!("not mock connection"), }