Use SeaQL/strum
This commit is contained in:
parent
2f456d972f
commit
e40455e771
@ -35,8 +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 = { path = "../strum/strum", version = "^0.21", features = [ "derive" ] }
|
||||
strum = { git = "https://github.com/billy1624/strum.git", branch = "re-export-macros", version = "^0.21", features = [ "derive" ] }
|
||||
strum = { git = "https://github.com/SeaQL/strum.git", branch = "sea-orm", version = "^0.21", features = [ "derive", "sea-orm" ] }
|
||||
serde_json = { version = "^1", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
|
@ -6,7 +6,7 @@ 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-orm = { path = "../../", features = [ "sqlx-mysql", "runtime-async-std-native-tls", "debug-print", "sqlx-json", "macros" ], default-features = false }
|
||||
serde_json = { version = "^1" }
|
||||
futures = { version = "^0.3" }
|
||||
async-stream = { version = "^0.3" }
|
||||
|
@ -16,14 +16,12 @@ 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,
|
||||
}
|
||||
@ -35,7 +33,6 @@ impl PrimaryKeyTrait for PrimaryKey {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter)]
|
||||
#[strum(crate_path = "sea_orm::strum")]
|
||||
pub enum Relation {
|
||||
Fruit,
|
||||
}
|
||||
|
@ -16,14 +16,12 @@ 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,
|
||||
@ -36,7 +34,6 @@ impl PrimaryKeyTrait for PrimaryKey {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter)]
|
||||
#[strum(crate_path = "sea_orm::strum")]
|
||||
pub enum Relation {
|
||||
Cake,
|
||||
Filling,
|
||||
|
@ -16,14 +16,12 @@ 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,
|
||||
}
|
||||
@ -35,7 +33,6 @@ impl PrimaryKeyTrait for PrimaryKey {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter)]
|
||||
#[strum(crate_path = "sea_orm::strum")]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ColumnTrait for Column {
|
||||
|
@ -17,7 +17,6 @@ pub struct Model {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
|
||||
#[strum(crate_path = "sea_orm::strum")]
|
||||
pub enum Column {
|
||||
Id,
|
||||
Name,
|
||||
@ -25,7 +24,6 @@ pub enum Column {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
|
||||
#[strum(crate_path = "sea_orm::strum")]
|
||||
pub enum PrimaryKey {
|
||||
Id,
|
||||
}
|
||||
@ -37,7 +35,6 @@ impl PrimaryKeyTrait for PrimaryKey {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter)]
|
||||
#[strum(crate_path = "sea_orm::strum")]
|
||||
pub enum Relation {
|
||||
Cake,
|
||||
}
|
||||
|
@ -17,14 +17,12 @@ 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,
|
||||
}
|
||||
@ -36,7 +34,6 @@ impl PrimaryKeyTrait for PrimaryKey {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter)]
|
||||
#[strum(crate_path = "sea_orm::strum")]
|
||||
pub enum Relation {
|
||||
Fruit,
|
||||
}
|
||||
|
@ -17,14 +17,12 @@ 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,
|
||||
@ -37,7 +35,6 @@ impl PrimaryKeyTrait for PrimaryKey {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter)]
|
||||
#[strum(crate_path = "sea_orm::strum")]
|
||||
pub enum Relation {
|
||||
Cake,
|
||||
Filling,
|
||||
|
@ -17,14 +17,12 @@ 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,
|
||||
}
|
||||
@ -36,7 +34,6 @@ impl PrimaryKeyTrait for PrimaryKey {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter)]
|
||||
#[strum(crate_path = "sea_orm::strum")]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ColumnTrait for Column {
|
||||
|
@ -18,7 +18,6 @@ pub struct Model {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
|
||||
#[strum(crate_path = "sea_orm::strum")]
|
||||
pub enum Column {
|
||||
Id,
|
||||
Name,
|
||||
@ -26,7 +25,6 @@ pub enum Column {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
|
||||
#[strum(crate_path = "sea_orm::strum")]
|
||||
pub enum PrimaryKey {
|
||||
Id,
|
||||
}
|
||||
@ -38,7 +36,6 @@ impl PrimaryKeyTrait for PrimaryKey {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter)]
|
||||
#[strum(crate_path = "sea_orm::strum")]
|
||||
pub enum Relation {
|
||||
Cake,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user