MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / getShortestName

Method getShortestName

packages/sql/src/schema/DatabaseTable.ts:817–829  ·  view source on GitHub ↗

* The shortest name is stripped of the default namespace. All other namespaced elements are returned as full-qualified names.

(skipDefaultSchema = true)

Source from the content-addressed store, hash-verified

815 * The shortest name is stripped of the default namespace. All other namespaced elements are returned as full-qualified names.
816 */
817 getShortestName(skipDefaultSchema = true): string {
818 const defaultSchema = this.#platform.getDefaultSchemaName();
819
820 if (
821 !this.schema ||
822 this.name.startsWith(defaultSchema + '.') ||
823 (this.schema === defaultSchema && skipDefaultSchema)
824 ) {
825 return this.name;
826 }
827
828 return `${this.schema}.${this.name}`;
829 }
830
831 getForeignKeys(): Dictionary<ForeignKey> {
832 return this.#foreignKeys;

Callers 10

getQuotedNameMethod · 0.95
addColumnFromPropertyMethod · 0.95
compareMethod · 0.80
diffTableMethod · 0.80
getDropSchemaSQLMethod · 0.80
preAlterTableMethod · 0.80
addTPTForeignKeyMethod · 0.80
createIndexFunction · 0.80
createIndexMethod · 0.80
getEntityMetadataMethod · 0.80

Calls 1

getDefaultSchemaNameMethod · 0.45

Tested by

no test coverage detected