Options
All
  • Public
  • Public/Protected
  • All
Menu

Naming strategy defines how auto-generated names for such things like table name, or table column gonna be generated.

Hierarchy

  • NamingStrategyInterface

Implemented by

Index

Properties

Optional name

name: undefined | string

Naming strategy name.

Methods

checkConstraintName

  • checkConstraintName(tableOrName: Table | string, expression: string): string

closureJunctionTableName

  • closureJunctionTableName(originalClosureTableName: string): string
  • Creates a table name for a junction table of a closure table.

    Parameters

    • originalClosureTableName: string

      Name of the closure table which owns this junction table.

    Returns string

columnName

  • columnName(propertyName: string, customName: string | undefined, embeddedPrefixes: string[]): string

defaultConstraintName

  • defaultConstraintName(tableOrName: Table | string, columnName: string): string

foreignKeyName

  • foreignKeyName(tableOrName: Table | string, columnNames: string[]): string

indexName

  • indexName(tableOrName: Table | string, columns: string[], where?: undefined | string): string

joinColumnName

  • joinColumnName(relationName: string, referencedColumnName: string): string

joinTableColumnDuplicationPrefix

  • joinTableColumnDuplicationPrefix(columnName: string, index: number): string
  • Columns in join tables can have duplicate names in case of self-referencing. This method provide a resolution for such column names.

    Parameters

    • columnName: string
    • index: number

    Returns string

joinTableColumnName

  • joinTableColumnName(tableName: string, propertyName: string, columnName?: undefined | string): string
  • Gets the name of the column used for columns in the junction tables.

    The reverse?:boolean parameter denotes if the joinTableColumnName is called for the junctionColumn (false) or the inverseJunctionColumns (true)

    Parameters

    • tableName: string
    • propertyName: string
    • Optional columnName: undefined | string

    Returns string

joinTableInverseColumnName

  • joinTableInverseColumnName(tableName: string, propertyName: string, columnName?: undefined | string): string
  • Gets the name of the column used for columns in the junction tables from the invers side of the relationship.

    Parameters

    • tableName: string
    • propertyName: string
    • Optional columnName: undefined | string

    Returns string

joinTableName

  • joinTableName(firstTableName: string, secondTableName: string, firstPropertyName: string, secondPropertyName: string): string
  • Gets the name of the join table used in the many-to-many relations.

    Parameters

    • firstTableName: string
    • secondTableName: string
    • firstPropertyName: string
    • secondPropertyName: string

    Returns string

prefixTableName

  • prefixTableName(prefix: string, tableName: string): string
  • Adds globally set prefix to the table name. This method is executed no matter if prefix was set or not. Table name is either user's given table name, either name generated from entity target. Note that table name comes here already normalized by #tableName method.

    Parameters

    • prefix: string
    • tableName: string

    Returns string

primaryKeyName

  • primaryKeyName(tableOrName: Table | string, columnNames: string[]): string

relationConstraintName

  • relationConstraintName(tableOrName: Table | string, columnNames: string[], where?: undefined | string): string
  • Gets the relation constraint (UNIQUE or UNIQUE INDEX) name from the given table name, column names and WHERE condition, if UNIQUE INDEX used.

    Parameters

    • tableOrName: Table | string
    • columnNames: string[]
    • Optional where: undefined | string

    Returns string

relationName

  • relationName(propertyName: string): string

tableName

  • tableName(targetName: string, userSpecifiedName: string | undefined): string
  • Normalizes table name.

    Parameters

    • targetName: string

      Name of the target entity that can be used to generate a table name.

    • userSpecifiedName: string | undefined

      For example if user specified a table name in a decorator, e.g. @Entity("name")

    Returns string

uniqueConstraintName

  • uniqueConstraintName(tableOrName: Table | string, columnNames: string[]): string

Generated using TypeDoc