MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / setup

Function setup

sea-orm-codegen/src/entity/writer.rs:1058–1705  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1056 use std::io::{self, BufRead, BufReader, Read};
1057
1058 fn setup() -> Vec<Entity> {
1059 vec![
1060 Entity {
1061 table_name: "cake".to_owned(),
1062 columns: vec![
1063 Column {
1064 name: "id".to_owned(),
1065 col_type: ColumnType::Integer,
1066 auto_increment: true,
1067 not_null: true,
1068 unique: false,
1069 },
1070 Column {
1071 name: "name".to_owned(),
1072 col_type: ColumnType::Text,
1073 auto_increment: false,
1074 not_null: false,
1075 unique: false,
1076 },
1077 ],
1078 relations: vec![Relation {
1079 ref_table: "fruit".to_owned(),
1080 columns: vec![],
1081 ref_columns: vec![],
1082 rel_type: RelationType::HasMany,
1083 on_delete: None,
1084 on_update: None,
1085 self_referencing: false,
1086 num_suffix: 0,
1087 impl_related: true,
1088 }],
1089 conjunct_relations: vec![ConjunctRelation {
1090 via: "cake_filling".to_owned(),
1091 to: "filling".to_owned(),
1092 }],
1093 primary_keys: vec![PrimaryKey {
1094 name: "id".to_owned(),
1095 }],
1096 },
1097 Entity {
1098 table_name: "_cake_filling_".to_owned(),
1099 columns: vec![
1100 Column {
1101 name: "cake_id".to_owned(),
1102 col_type: ColumnType::Integer,
1103 auto_increment: false,
1104 not_null: true,
1105 unique: false,
1106 },
1107 Column {
1108 name: "filling_id".to_owned(),
1109 col_type: ColumnType::Integer,
1110 auto_increment: false,
1111 not_null: true,
1112 unique: false,
1113 },
1114 ],
1115 relations: vec![

Callers 7

test_gen_with_serdeFunction · 0.70
test_gen_with_derivesFunction · 0.70
test_gen_with_attributesFunction · 0.70

Calls

no outgoing calls

Tested by 7

test_gen_with_serdeFunction · 0.56
test_gen_with_derivesFunction · 0.56
test_gen_with_attributesFunction · 0.56