Skip to content

Commit

Permalink
Re-export strum_macros
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 authored and tyt2y3 committed Jul 1, 2021
1 parent 87c8d0d commit 7bf79ae
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sea-query = { version = "^0.12" }
sea-orm-macros = { path = "sea-orm-macros", optional = true }
serde = { version = "^1.0", features = [ "derive" ] }
sqlx = { version = "^0.5", optional = true }
strum = { version = "^0.20", features = [ "derive" ] }
strum = { path = "../strum/strum", version = "^0.21", features = [ "derive" ] }
serde_json = { version = "^1", optional = true }

[dev-dependencies]
Expand Down
1 change: 0 additions & 1 deletion examples/sqlx-mysql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
strum = { version = "^0.20", features = [ "derive" ] }
serde_json = { version = "^1" }
futures = { version = "^0.3" }
async-stream = { version = "^0.3" }
Expand Down
3 changes: 3 additions & 0 deletions examples/sqlx-mysql/src/example_cake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ pub struct Model {
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Column {
Id,
Name,
}

#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
#[strum(crate_path = "sea_orm::strum")]
pub enum PrimaryKey {
Id,
}
Expand All @@ -33,6 +35,7 @@ impl PrimaryKeyTrait for PrimaryKey {
}

#[derive(Copy, Clone, Debug, EnumIter)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Relation {
Fruit,
}
Expand Down
3 changes: 3 additions & 0 deletions examples/sqlx-mysql/src/example_cake_filling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ pub struct Model {
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Column {
CakeId,
FillingId,
}

#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
#[strum(crate_path = "sea_orm::strum")]
pub enum PrimaryKey {
CakeId,
FillingId,
Expand All @@ -34,6 +36,7 @@ impl PrimaryKeyTrait for PrimaryKey {
}

#[derive(Copy, Clone, Debug, EnumIter)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Relation {
Cake,
Filling,
Expand Down
3 changes: 3 additions & 0 deletions examples/sqlx-mysql/src/example_filling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ pub struct Model {
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Column {
Id,
Name,
}

#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
#[strum(crate_path = "sea_orm::strum")]
pub enum PrimaryKey {
Id,
}
Expand All @@ -33,6 +35,7 @@ impl PrimaryKeyTrait for PrimaryKey {
}

#[derive(Copy, Clone, Debug, EnumIter)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Relation {}

impl ColumnTrait for Column {
Expand Down
3 changes: 3 additions & 0 deletions examples/sqlx-mysql/src/example_fruit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ pub struct Model {
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Column {
Id,
Name,
CakeId,
}

#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
#[strum(crate_path = "sea_orm::strum")]
pub enum PrimaryKey {
Id,
}
Expand All @@ -35,6 +37,7 @@ impl PrimaryKeyTrait for PrimaryKey {
}

#[derive(Copy, Clone, Debug, EnumIter)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Relation {
Cake,
}
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,4 @@ pub use sea_orm_macros::{
pub use sea_query;
pub use sea_query::Iden;
pub use strum::EnumIter;
pub use strum;
3 changes: 3 additions & 0 deletions src/tests_cfg/cake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ pub struct Model {
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Column {
Id,
Name,
}

#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
#[strum(crate_path = "sea_orm::strum")]
pub enum PrimaryKey {
Id,
}
Expand All @@ -34,6 +36,7 @@ impl PrimaryKeyTrait for PrimaryKey {
}

#[derive(Copy, Clone, Debug, EnumIter)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Relation {
Fruit,
}
Expand Down
3 changes: 3 additions & 0 deletions src/tests_cfg/cake_filling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ pub struct Model {
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Column {
CakeId,
FillingId,
}

#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
#[strum(crate_path = "sea_orm::strum")]
pub enum PrimaryKey {
CakeId,
FillingId,
Expand All @@ -35,6 +37,7 @@ impl PrimaryKeyTrait for PrimaryKey {
}

#[derive(Copy, Clone, Debug, EnumIter)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Relation {
Cake,
Filling,
Expand Down
3 changes: 3 additions & 0 deletions src/tests_cfg/filling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ pub struct Model {
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Column {
Id,
Name,
}

#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
#[strum(crate_path = "sea_orm::strum")]
pub enum PrimaryKey {
Id,
}
Expand All @@ -34,6 +36,7 @@ impl PrimaryKeyTrait for PrimaryKey {
}

#[derive(Copy, Clone, Debug, EnumIter)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Relation {}

impl ColumnTrait for Column {
Expand Down
3 changes: 3 additions & 0 deletions src/tests_cfg/fruit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ pub struct Model {
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Column {
Id,
Name,
CakeId,
}

#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
#[strum(crate_path = "sea_orm::strum")]
pub enum PrimaryKey {
Id,
}
Expand All @@ -36,6 +38,7 @@ impl PrimaryKeyTrait for PrimaryKey {
}

#[derive(Copy, Clone, Debug, EnumIter)]
#[strum(crate_path = "sea_orm::strum")]
pub enum Relation {
Cake,
}
Expand Down

0 comments on commit 7bf79ae

Please sign in to comment.