UNPKG

2.63 kBTypeScriptView Raw
1import { NamingStrategyInterface } from "./NamingStrategyInterface";
2import { Table } from "../schema-builder/table/Table";
3/**
4 * Naming strategy that is used by default.
5 */
6export declare class DefaultNamingStrategy implements NamingStrategyInterface {
7 /**
8 * Normalizes table name.
9 *
10 * @param targetName Name of the target entity that can be used to generate a table name.
11 * @param userSpecifiedName For example if user specified a table name in a decorator, e.g. @Entity("name")
12 */
13 tableName(targetName: string, userSpecifiedName: string | undefined): string;
14 /**
15 * Creates a table name for a junction table of a closure table.
16 *
17 * @param originalClosureTableName Name of the closure table which owns this junction table.
18 */
19 closureJunctionTableName(originalClosureTableName: string): string;
20 columnName(propertyName: string, customName: string, embeddedPrefixes: string[]): string;
21 relationName(propertyName: string): string;
22 primaryKeyName(tableOrName: Table | string, columnNames: string[]): string;
23 uniqueConstraintName(tableOrName: Table | string, columnNames: string[]): string;
24 relationConstraintName(tableOrName: Table | string, columnNames: string[], where?: string): string;
25 defaultConstraintName(tableOrName: Table | string, columnName: string): string;
26 foreignKeyName(tableOrName: Table | string, columnNames: string[]): string;
27 indexName(tableOrName: Table | string, columnNames: string[], where?: string): string;
28 checkConstraintName(tableOrName: Table | string, expression: string): string;
29 exclusionConstraintName(tableOrName: Table | string, expression: string): string;
30 joinColumnName(relationName: string, referencedColumnName: string): string;
31 joinTableName(firstTableName: string, secondTableName: string, firstPropertyName: string, secondPropertyName: string): string;
32 joinTableColumnDuplicationPrefix(columnName: string, index: number): string;
33 joinTableColumnName(tableName: string, propertyName: string, columnName?: string): string;
34 joinTableInverseColumnName(tableName: string, propertyName: string, columnName?: string): string;
35 /**
36 * Adds globally set prefix to the table name.
37 * This method is executed no matter if prefix was set or not.
38 * Table name is either user's given table name, either name generated from entity target.
39 * Note that table name comes here already normalized by #tableName method.
40 */
41 prefixTableName(prefix: string, tableName: string): string;
42 eagerJoinRelationAlias(alias: string, propertyPath: string): string;
43}