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

Method addTable

packages/sql/src/schema/DatabaseSchema.ts:38–50  ·  view source on GitHub ↗
(name: string, schema: string | undefined | null, comment?: string)

Source from the content-addressed store, hash-verified

36 }
37
38 addTable(name: string, schema: string | undefined | null, comment?: string): DatabaseTable {
39 const namespaceName = schema ?? this.name;
40 const table = new DatabaseTable(this.#platform, name, namespaceName);
41 table.nativeEnums = this.#nativeEnums;
42 table.comment = comment;
43 this.#tables.push(table);
44
45 if (namespaceName != null) {
46 this.#namespaces.add(namespaceName);
47 }
48
49 return table;
50 }
51
52 getTables(): DatabaseTable[] {
53 return this.#tables;

Callers 7

fromMetadataMethod · 0.95
loadInformationSchemaMethod · 0.80
loadInformationSchemaMethod · 0.80
loadInformationSchemaMethod · 0.80
loadInformationSchemaMethod · 0.80
loadInformationSchemaMethod · 0.80
loadInformationSchemaMethod · 0.80

Calls 2

pushMethod · 0.80
addMethod · 0.80

Tested by

no test coverage detected