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

Method getQueries

packages/migrations/src/MigrationRunner.ts:90–104  ·  view source on GitHub ↗
(migration: Migration, method: 'up' | 'down')

Source from the content-addressed store, hash-verified

88 }
89
90 private async getQueries(migration: Migration, method: 'up' | 'down') {
91 await migration[method]();
92 const charset = this.config.get('charset')!;
93 let queries = migration.getQueries();
94 queries.unshift(...this.#helper.getSchemaBeginning(charset, this.options.disableForeignKeys).split('\n'));
95
96 if (this.#runSchema) {
97 queries.unshift(this.#helper.getSetSchemaSQL(this.#runSchema));
98 }
99
100 queries.push(...this.#helper.getSchemaEnd(this.options.disableForeignKeys).split('\n'));
101 queries = queries.filter(sql => typeof sql !== 'string' || sql.trim().length > 0);
102
103 return queries;
104 }
105}

Callers 1

runMethod · 0.95

Calls 6

pushMethod · 0.80
filterMethod · 0.80
getMethod · 0.65
getQueriesMethod · 0.65
getSchemaBeginningMethod · 0.45
getSetSchemaSQLMethod · 0.45

Tested by

no test coverage detected