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

Function initORMMsSql

tests/bootstrap.ts:255–279  ·  view source on GitHub ↗
(additionalOptions: Partial<Options<MsSqlDriver>> = {}, createSchema = true)

Source from the content-addressed store, hash-verified

253}
254
255export async function initORMMsSql(additionalOptions: Partial<Options<MsSqlDriver>> = {}, createSchema = true) {
256 const dbName = `mikro_orm_test_${(Math.random() + 1).toString(36).substring(2)}`;
257 const orm = await MikroORM.init({
258 entities: ['entities-mssql'],
259 dbName,
260 baseDir: BASE_DIR,
261 driver: MsSqlDriver,
262 password: 'Root.Root',
263 debug: true,
264 logger: i => i,
265 metadataProvider: ReflectMetadataProvider,
266 extensions: [Migrator, SeedManager, EntityGenerator],
267 ...additionalOptions,
268 });
269
270 if (createSchema) {
271 await orm.schema.refresh();
272 }
273
274 Author2Subscriber.log.length = 0;
275 EverythingSubscriber.log.length = 0;
276 FlushSubscriber.log.length = 0;
277
278 return orm;
279}
280
281export async function initORMOracleDb(
282 dbName = 'mikro_orm_test_sg',

Calls 3

initMethod · 0.65
refreshMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected