refrakt_cli/types
Types
The parent of a resource generated with --belongs-to <parent>.
For gen resource comments body:text --belongs-to posts:
Relation(plural: "posts", singular: "post", type_name: "Post", table: "posts", field: "post_id", label: Some("title")).
pub type Relation {
Relation(
plural: String,
singular: String,
type_name: String,
table: String,
field: String,
label: option.Option(String),
)
}
Constructors
-
Relation( plural: String, singular: String, type_name: String, table: String, field: String, label: option.Option(String), )Arguments
- plural
-
The parent resource as given to
--belongs-to; its routes live under/<plural>. - table
-
The parent’s table, named the way
gen resourcenames tables. - field
-
The foreign key column and field of the child,
<singular>_id. - label
-
The parent’s first required string field, used to label parents in a
<select>;Nonelabels them by id.