forked from SeaQL/sea-orm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from billy1624/pr/988
Fix clippy warnings & test cases
- Loading branch information
Showing
6 changed files
with
159 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! SeaORM Entity. Generated by sea-orm-codegen 0.1.0 | ||
use sea_orm::entity::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] | ||
#[sea_orm(table_name = "cake_with_double")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
pub id: i32, | ||
#[sea_orm(column_type = "Text", nullable)] | ||
pub name: Option<String> , | ||
#[sea_orm(column_type = "Double(Some(2))", nullable)] | ||
pub price: Option<f64> , | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm(has_many = "super::fruit::Entity")] | ||
Fruit, | ||
} | ||
|
||
impl Related<super::fruit::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::Fruit.def() | ||
} | ||
} | ||
|
||
impl Related<super::filling::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
super::cake_filling::Relation::Filling.def() | ||
} | ||
fn via() -> Option<RelationDef> { | ||
Some(super::cake_filling::Relation::CakeWithDouble.def().rev()) | ||
} | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! SeaORM Entity. Generated by sea-orm-codegen 0.1.0 | ||
use sea_orm::entity::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] | ||
#[sea_orm(table_name = "cake_with_float")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
pub id: i32, | ||
#[sea_orm(column_type = "Text", nullable)] | ||
pub name: Option<String> , | ||
#[sea_orm(column_type = "Float(Some(2))", nullable)] | ||
pub price: Option<f32> , | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm(has_many = "super::fruit::Entity")] | ||
Fruit, | ||
} | ||
|
||
impl Related<super::fruit::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::Fruit.def() | ||
} | ||
} | ||
|
||
impl Related<super::filling::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
super::cake_filling::Relation::Filling.def() | ||
} | ||
fn via() -> Option<RelationDef> { | ||
Some(super::cake_filling::Relation::CakeWithFloat.def().rev()) | ||
} | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
37 changes: 37 additions & 0 deletions
37
sea-orm-codegen/tests/compact_with_schema_name/cake_with_double.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! SeaORM Entity. Generated by sea-orm-codegen 0.1.0 | ||
use sea_orm::entity::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] | ||
#[sea_orm(schema_name = "schema_name", table_name = "cake_with_double")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
pub id: i32, | ||
#[sea_orm(column_type = "Text", nullable)] | ||
pub name: Option<String> , | ||
#[sea_orm(column_type = "Double(Some(2))", nullable)] | ||
pub price: Option<f64> , | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm(has_many = "super::fruit::Entity")] | ||
Fruit, | ||
} | ||
|
||
impl Related<super::fruit::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::Fruit.def() | ||
} | ||
} | ||
|
||
impl Related<super::filling::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
super::cake_filling::Relation::Filling.def() | ||
} | ||
fn via() -> Option<RelationDef> { | ||
Some(super::cake_filling::Relation::CakeWithDouble.def().rev()) | ||
} | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
37 changes: 37 additions & 0 deletions
37
sea-orm-codegen/tests/compact_with_schema_name/cake_with_float.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! SeaORM Entity. Generated by sea-orm-codegen 0.1.0 | ||
use sea_orm::entity::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] | ||
#[sea_orm(schema_name = "schema_name", table_name = "cake_with_float")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
pub id: i32, | ||
#[sea_orm(column_type = "Text", nullable)] | ||
pub name: Option<String> , | ||
#[sea_orm(column_type = "Float(Some(2))", nullable)] | ||
pub price: Option<f32> , | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm(has_many = "super::fruit::Entity")] | ||
Fruit, | ||
} | ||
|
||
impl Related<super::fruit::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::Fruit.def() | ||
} | ||
} | ||
|
||
impl Related<super::filling::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
super::cake_filling::Relation::Filling.def() | ||
} | ||
fn via() -> Option<RelationDef> { | ||
Some(super::cake_filling::Relation::CakeWithFloat.def().rev()) | ||
} | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |