#249 Demo of 'pure' crate depending on SeaORM
This commit is contained in:
parent
32f82a0c9b
commit
45f3548d4f
@ -1,11 +1,2 @@
|
||||
[workspace]
|
||||
# A separate workspace
|
||||
|
||||
[package]
|
||||
name = "sea-orm-issues-249"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
sea-orm = { path = "../../", default-features = false, features = ["mock"] }
|
||||
members = ["core", "app"]
|
||||
|
9
issues/249/app/Cargo.toml
Normal file
9
issues/249/app/Cargo.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "sea-orm-issues-249-app"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
core = { path = "../core" }
|
||||
sea-orm = { path = "../../../", default-features = false, features = ["macros", "sqlx-sqlite", "runtime-async-std-native-tls"] }
|
14
issues/249/app/src/main.rs
Normal file
14
issues/249/app/src/main.rs
Normal file
@ -0,0 +1,14 @@
|
||||
use core::clone_a_model;
|
||||
|
||||
use sea_orm::tests_cfg::cake;
|
||||
|
||||
fn main() {
|
||||
let c1 = cake::Model {
|
||||
id: 1,
|
||||
name: "Cheese".to_owned(),
|
||||
};
|
||||
|
||||
let c2 = clone_a_model(&c1);
|
||||
|
||||
println!("{:?}", c2);
|
||||
}
|
11
issues/249/core/Cargo.toml
Normal file
11
issues/249/core/Cargo.toml
Normal file
@ -0,0 +1,11 @@
|
||||
[package]
|
||||
name = "core"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
sea-orm = { path = "../../../", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
sea-orm = { path = "../../../", features = ["mock"] }
|
7
issues/249/core/src/lib.rs
Normal file
7
issues/249/core/src/lib.rs
Normal file
@ -0,0 +1,7 @@
|
||||
pub use sea_orm::entity::*;
|
||||
|
||||
pub fn clone_a_model<M>(model: &M) -> M
|
||||
where
|
||||
M: ModelTrait {
|
||||
model.clone()
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user