Fix example

This commit is contained in:
Chris Tsang 2021-06-19 16:59:26 +08:00
parent 041d28aa26
commit 5d84c88ccd
2 changed files with 3 additions and 4 deletions

View File

@ -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" }

View File

@ -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"),
}