ORM Column
Structs¶
None
OrmColumn¶
Represents a database column with metadata for ORM transformations. It includes details such as column name, data types, property name, and constraints.
Fields:¶
- ColumnName (string): Name of the column in the database.
- OrmType (string): The ORM type associated with this column.
- DatabaseType (string): The database native type for this column.
- PropertyName (string): The corresponding property name in the ORM model.
- IsPrimaryKey (bool): Indicates whether the column is a primary key.
- IsNullable (bool): Specifies whether the column can have
NULLvalues. - IsAutoIncrement (bool): Indicates if the column is auto-incrementing.
Functions¶
GetPropertyNameInCase¶
Returns the PropertyName of the OrmColumn converted to the specified case format.
Parameters:¶
- caseToReturn (string): The desired case style (e.g., "pascal", "camel", "kebab", or "snake").
Returns:¶
- (string): The PropertyName formatted in the specified case.¶
GetColumnNameInCase¶
Returns the ColumnName formatted in the specified case style (e.g., camel, snake, kebab, pascal).
Parameters:¶
- caseToReturn (string): The desired case style (e.g., "pascal", "camel", "kebab", or "snake").
Returns:¶
- (string): The
ColumnNameformatted in the specified case.
getCaseValue¶
Transforms a string to a specified case format such as pascal, camel, kebab, or snake based on the input.
Parameters:¶
- caseToReturn (string): The desired case style (e.g., "pascal", "camel", "kebab", or "snake").
- value (string): The input string to be transformed.
Returns:¶
- (string): The input string formatted to the specified case.
Functions¶
GetPropertyNameInCase¶
Returns the PropertyName of the OrmColumn converted to the specified case format.
Parameters:¶
- caseToReturn (string): The desired case style (e.g., "pascal", "camel", "kebab", or "snake").
Returns:¶
- (string): The
PropertyNameformatted in the specified case.
GetColumnNameInCase¶
Returns the ColumnName formatted in the specified case style (e.g., camel, snake, kebab, pascal).
Parameters:¶
- caseToReturn (string): The desired case style (e.g., "pascal", "camel", "kebab", "screamingKebab", "snake" or "screamingSnake").
Returns:¶
- (string): The
ColumnNameformatted in the specified case.