Foreign Key
Monstarillo Foreign Key
- Structs
- Functions
- GetFkTableNameInCase
- GetFkColumnNameInCase
- GetPkColumnNameInCase
- GetCamelCaseFKTableName
- GetPascalCaseFKTableName
- GetCamelCaseFKColumnName
- GetPascalCaseFKColumnName
- GetCamelCasePKTableName
- GetPascalCasePKTableName
- GetCamelCasePKColumnName
- GetPascalCasePKColumnName
- GetCamelCaseFKTableNamePlural
- GetFKTableNamePluralInCase
- GetPascalCaseFKTableNamePlural
- GetCamelCasePKTableNamePlural
- GetPascalCasePKTableNamePlural
On this page
- Structs
- Functions
- GetFkTableNameInCase
- GetFkColumnNameInCase
- GetPkColumnNameInCase
- GetCamelCaseFKTableName
- GetPascalCaseFKTableName
- GetCamelCaseFKColumnName
- GetPascalCaseFKColumnName
- GetCamelCasePKTableName
- GetPascalCasePKTableName
- GetCamelCasePKColumnName
- GetPascalCasePKColumnName
- GetCamelCaseFKTableNamePlural
- GetFKTableNamePluralInCase
- GetPascalCaseFKTableNamePlural
- GetCamelCasePKTableNamePlural
- GetPascalCasePKTableNamePlural
Structs
None
ForeignKey
Represents the structure of a foreign key relationship in a database.
Fields:
- ConstraintName (string): The name of the foreign key constraint.
- FkTableName (string): The name of the foreign key table.
- FkColumnName (string): The name of the foreign key column.
- PkTableName (string): The name of the primary key table.
- PkColumnName (string): The name of the primary key column.
- Relation (string): The type of the relationship.
- FkColumn (Column): The foreign key column details.
- PkColumn (Column): The primary key column details.
Functions
GetFkTableNameInCase
func (f *ForeignKey) GetFkTableNameInCase(caseToReturn string) string
Formats the foreign key table name into the specified case style (e.g., camel, pascal, snake, kebab).
Parameters:
- caseToReturn (string): The desired case style.
Returns:
- (string): The foreign key table name in the specified case.
GetFkColumnNameInCase
func (f *ForeignKey) GetFkColumnNameInCase(caseToReturn string) string
Formats the foreign key column name into the specified case style.
Parameters:
- caseToReturn (string): The desired case style.
Returns:
- (string): The foreign key column name in the specified case.
GetPkColumnNameInCase
func (f *ForeignKey) GetPkColumnNameInCase(caseToReturn string) string
Formats the primary key column name into the specified case style.
Parameters:
- caseToReturn (string): The desired case style.
Returns:
- (string): The primary key column name in the specified case.
GetCamelCaseFKTableName
func (f *ForeignKey) GetCamelCaseFKTableName() string
Returns the foreign key table name in camel case format.
Returns:
- (string): The camel case formatted foreign key table name.
GetPascalCaseFKTableName
func (f *ForeignKey) GetPascalCaseFKTableName() string
Returns the foreign key table name in PascalCase format.
Returns:
- (string): The PascalCase formatted foreign key table name.
GetCamelCaseFKColumnName
func (f *ForeignKey) GetCamelCaseFKColumnName() string
Returns the foreign key column name in camel case format.
Returns:
- (string): The camel case formatted foreign key column name.
GetPascalCaseFKColumnName
func (f *ForeignKey) GetPascalCaseFKColumnName() string
Returns the foreign key column name in PascalCase format.
Returns:
- (string): The PascalCase formatted foreign key column name.
GetCamelCasePKTableName
func (f *ForeignKey) GetCamelCasePKTableName() string
Returns the primary key table name in camel case format.
Returns:
- (string): The camel case formatted primary key table name.
GetPascalCasePKTableName
func (f *ForeignKey) GetPascalCasePKTableName() string
Returns the primary key table name in PascalCase format.
Returns:
- (string): The PascalCase formatted primary key table name.
GetCamelCasePKColumnName
func (f *ForeignKey) GetCamelCasePKColumnName() string
Returns the primary key column name in camel case format.
Returns:
- (string): The camel case formatted primary key column name.
GetPascalCasePKColumnName
func (f *ForeignKey) GetPascalCasePKColumnName() string
Returns the primary key column name in PascalCase format.
Returns:
- (string): The PascalCase formatted primary key column name.
GetCamelCaseFKTableNamePlural
func (f *ForeignKey) GetCamelCaseFKTableNamePlural() string
Returns the camel case foreign key table name in plural form. Handles names ending in “s” properly.
Returns:
- (string): The pluralized camel case foreign key table name.
GetFKTableNamePluralInCase
func (f *ForeignKey) GetFKTableNamePluralInCase() string
Returns the foreign key table name in plural form and PascalCase format.
Returns:
- (string): The pluralized PascalCase foreign key table name.
GetPascalCaseFKTableNamePlural
func (f *ForeignKey) GetPascalCaseFKTableNamePlural(caseToReturn string) string
Formats the foreign key table name to plural form and specified case (e.g., PascalCase).
Parameters:
- caseToReturn (string): The desired case style to apply.
Returns:
- (string): The pluralized foreign key table name in specified case format.
GetCamelCasePKTableNamePlural
func (f *ForeignKey) GetCamelCasePKTableNamePlural() string
Returns the camel case primary key table name in plural form.
Returns:
- (string): The pluralized camel case primary key table name.
GetPascalCasePKTableNamePlural
func (f *ForeignKey) GetPascalCasePKTableNamePlural() string
Returns the PascalCase primary key table name in plural form.
Returns:
- (string): The pluralized PascalCase primary key table name.