Column
Structs¶
None
Column¶
Represents a database column with detailed metadata.
Fields:¶
- ColumnName (string): The name of the column.
- DataType (string): The data type of the column.
- DatabaseType (string): The database type (e.g., MySQL, Postgres).
- TableName (string): The name of the table the column belongs to.
- PkTableName (string): The name of the primary key table (if applicable).
- PkColumnName (string): The name of the primary key column (if applicable).
- IsPrimaryKey (bool): Indicates if the column is a primary key.
- IsNullable (bool): Indicates if the column can accept null values.
- IsAutoIncrement (bool): Indicates if the column is auto-incremented.
- IsForeignKey (bool): Indicates if the column is a foreign key.
- OrdinalPosition (int): The position of the column in the table.
- NumericPrecision (int): The numeric precision of the column (if applicable).
- NumericScale (int): The numeric scale of the column (if applicable).
- CharacterMaximumLength (int): The maximum length of the column (if applicable).
Functions¶
GetCamelCaseColumnName¶
Returns the column name in camelCase format.
Returns:¶
- (string): The camelCase formatted column name.
GetTitleCaseColumnName¶
Returns the column name in Title Case format.
Returns:¶
- (string): The Title Case formatted column name.
GetPascalCaseColumnName¶
Returns the column name in PascalCase format.
Returns:¶
- (string): The PascalCase formatted column name.
GetColumnNameInCase¶
Returns the column name converted to the specified case format.
Parameters:¶
- caseToReturn (string): The desired case format.
Returns:¶
- (string): The column name in the specified case format.
GetColumnTableNameInCase¶
Returns the table name the column belongs to, converted to the specified case format.
Parameters:¶
- caseToReturn (string): The desired case format.
Returns:¶
- (string): The table name in the specified case format.
GetPascalCaseTableName¶
Returns the table name in PascalCase format.
Returns:¶
- (string): The PascalCase formatted table name.
GetTitleCaseTableName¶
Returns the table name in Title Case format.
Returns:¶
- (string): The Title Case formatted table name.
GetJavascriptDefaultValue¶
Returns the default JavaScript value for the column based on its data type and numeric precision.
Returns:¶
- (string): The JavaScript default value for the column.
GetJavascriptDataType¶
Returns the JavaScript data type for the column based on its database type and data type.
Returns:¶
- (string): The JavaScript data type for the column.
GetJavaDataType¶
Returns the Java data type for the column based on its database type and data type.
Returns:¶
- (string): The Java data type for the column.
IsBinary¶
Determines if the column's Java data type represents binary data (byte[]
).
Returns:¶
- (bool):
true
if the column is binary, otherwisefalse
.
IsGoIntFamilyType¶
Determines whether the column's Go data type belongs to the integer family (e.g., int
, uint8
, int64
).
Returns:¶
- (bool):
true
if the column is an integer type, otherwisefalse
.
GetAspNetRouteConstraintType¶
Returns the ASP.NET route constraint type for the column based on its C# data type.
Returns:¶
- (string): The ASP.NET route constraint type.
GetCSharpDataType¶
Returns the C# data type for the column based on its database type and data type.
Returns:¶
- (string): The C# data type for the column.
GetGoDataType¶
Returns the Go data type for the column based on its database type and data type.
Returns:¶
- (string): The Go data type for the column.
GetCSharpFirstUnitTestValueFromFile¶
Retrieves the first unit test value for the column from a given file.
Parameters:¶
- valuesFile (string): The path to the file containing unit test values.
Returns:¶
- (string): The first unit test value for the column.