ORM Model
Structs¶
None
OrmModel¶
Represents a Database Model with metadata for ORM transformations.
Fields:¶
- TableName (string): The name of the table associated with the model.
- ModelName (string): The name of the model in the ORM context.
- Orm (string): The ORM library or framework being used.
- Columns ([]OrmColumn): A list of columns associated with the model.
Functions¶
GetModelNameInCase¶
Returns the ModelName of the OrmModel converted to the specified case format.
Parameters:¶
- caseToReturn (string): The desired case format (e.g., camel, pascal, snake, etc.).
Returns:¶
- (string): The
ModelNameconverted to the specified case format.
GetModelTableNameInCase¶
Returns the TableName of the OrmModel converted to the specified case format.
Parameters:¶
- caseToReturn (string): The desired case format (e.g., camel, pascal, snake, etc.).
Returns:¶
- (string): The
TableNameconverted to the specified case format.
GetPrimaryModelColumns¶
Returns a slice of OrmColumn objects that are marked as primary keys.
Returns:¶
- ([]OrmColumn): A list of primary key columns.
GetModelNamePluralInCase¶
Returns the pluralized TableName of the OrmModel converted to the specified case format.
Parameters:¶
- caseToReturn (string): The desired case format (e.g., camel, pascal, snake, screamingSnake, kebab or screamingKebab.).
Returns:¶
- (string): The pluralized
TableNameconverted to the specified case format.