Column

Monstarillo colum

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

func (c *Column) GetCamelCaseColumnName() string

Returns the column name in camelCase format.

Returns:

  • (string): The camelCase formatted column name.

GetTitleCaseColumnName

func (c *Column) GetTitleCaseColumnName() string

Returns the column name in Title Case format.

Returns:

  • (string): The Title Case formatted column name.

GetPascalCaseColumnName

func (c *Column) GetPascalCaseColumnName() string

Returns the column name in PascalCase format.

Returns:

  • (string): The PascalCase formatted column name.

GetColumnNameInCase

func (c *Column) GetColumnNameInCase(caseToReturn string) string

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

func (c *Column) GetColumnTableNameInCase(caseToReturn string) string

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

func (c *Column) GetPascalCaseTableName() string

Returns the table name in PascalCase format.

Returns:

  • (string): The PascalCase formatted table name.

GetTitleCaseTableName

func (c *Column) GetTitleCaseTableName() string

Returns the table name in Title Case format.

Returns:

  • (string): The Title Case formatted table name.

GetJavascriptDefaultValue

func (c *Column) GetJavascriptDefaultValue() string

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

func (c *Column) GetJavascriptDataType() string

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

func (c *Column) GetJavaDataType() string

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

func (c *Column) IsBinary() bool

Determines if the column’s Java data type represents binary data (byte[]).

Returns:

  • (bool): true if the column is binary, otherwise false.

IsGoIntFamilyType

func (c *Column) IsGoIntFamilyType() bool

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, otherwise false.

GetAspNetRouteConstraintType

func (c *Column) GetAspNetRouteConstraintType() string

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

func (c *Column) GetCSharpDataType() string

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

func (c *Column) GetGoDataType() string

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

func (c *Column) GetCSharpFirstUnitTestValueFromFile(valuesFile string) string

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.