feat: one-to-many relation helper
Allow one to specify that a field of a model is a foreign key. It will generate a bunch of helper methods to query related entities from one entity.
This commit is contained in:
parent
cbe60d1bd2
commit
5e0ffe67c3
25 changed files with 764 additions and 140 deletions
20
lib/sqlxgentools_cli/src/generators/mod.rs
Normal file
20
lib/sqlxgentools_cli/src/generators/mod.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
use fully_pub::fully_pub;
|
||||
use serde::Serialize;
|
||||
|
||||
pub mod migrations;
|
||||
pub mod repositories;
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
#[fully_pub]
|
||||
enum SourceNode {
|
||||
File(String),
|
||||
Directory(Vec<SourceNodeContainer>)
|
||||
}
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
#[fully_pub]
|
||||
struct SourceNodeContainer {
|
||||
name: String,
|
||||
inner: SourceNode
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue