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

Method addView

packages/sql/src/schema/DatabaseSchema.ts:74–90  ·  view source on GitHub ↗
(
    name: string,
    schema: string | undefined | null,
    definition: string,
    materialized?: boolean,
    withData?: boolean,
  )

Source from the content-addressed store, hash-verified

72 }
73
74 addView(
75 name: string,
76 schema: string | undefined | null,
77 definition: string,
78 materialized?: boolean,
79 withData?: boolean,
80 ): DatabaseView {
81 const namespaceName = schema ?? this.name;
82 const view: DatabaseView = { name, schema: namespaceName, definition, materialized, withData };
83 this.#views.push(view);
84
85 if (namespaceName != null) {
86 this.#namespaces.add(namespaceName);
87 }
88
89 return view;
90 }
91
92 getViews(): DatabaseView[] {
93 return this.#views;

Callers 7

fromMetadataMethod · 0.95
loadViewsMethod · 0.80
loadMaterializedViewsMethod · 0.80
loadViewsMethod · 0.80
loadViewsMethod · 0.80
loadViewsMethod · 0.80
loadViewsMethod · 0.80

Calls 2

pushMethod · 0.80
addMethod · 0.80

Tested by

no test coverage detected