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

Function createEntities

tests/sqlite-constraints.test.ts:26–38  ·  view source on GitHub ↗
(em: EntityManager)

Source from the content-addressed store, hash-verified

24}
25
26async function createEntities(em: EntityManager) {
27 const author = new Author();
28 author.id = '1';
29 author.name = 'Bradley Jones';
30
31 const book = new Book();
32 book.id = '2';
33 book.name = 'C++ in 21 days';
34 book.author = Reference.create(author);
35
36 await em.persist([author, book]).flush();
37 return author;
38}
39
40describe('sqlite driver', () => {
41 let orm: MikroORM<SqliteDriver>;

Callers 1

Calls 3

createMethod · 0.65
persistMethod · 0.65
flushMethod · 0.45

Tested by

no test coverage detected