Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/myxogastria0808/seaorm-relation-mytutorial
https://github.com/myxogastria0808/seaorm-relation-mytutorial
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/myxogastria0808/seaorm-relation-mytutorial
- Owner: Myxogastria0808
- Created: 2024-09-12T04:11:25.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-14T03:50:49.000Z (4 months ago)
- Last Synced: 2024-09-14T16:30:22.240Z (4 months ago)
- Language: Rust
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## One to One
sample_b は sample_a が存在しないと、生成できない関係
```mermaid
erDiagram
sample_a ||--o| sample_b : "one to one"
sample_a {
i32 Id PK
String Value
}
sample_b {
i32 Id PK
String Value
i32 SampleAId UK
}
```## One to Many
sample_d は sample_c が存在しないと、生成できない関係
```mermaid
erDiagram
sample_c ||--o{ sample_d : "one to many"
sample_c {
i32 Id PK
String Value
}
sample_d {
i32 Id PK
String Value
i32 SampleCId
}
```## Many to Many
junction が中間テーブル
```mermaid
erDiagram
sample_e ||--o{ junction : "one to many"
sample_f ||--o{ junction : "one to many"
sample_e {
i32 Id PK
String Value
}
sample_f {
i32 Id PK
String Value
}
junction {
i32 Id PK
i32 SampleEId
i32 SampleFId
}
```## 参考サイト
https://www.sea-ql.org/SeaORM/docs/relation/one-to-one/
https://www.sea-ql.org/SeaORM/docs/relation/one-to-many/
https://www.sea-ql.org/SeaORM/docs/relation/many-to-many/
https://www.sea-ql.org/SeaORM/docs/basic-crud/select/
https://zenn.dev/icy_mountain/scraps/dd0ff88411efdb