MCPcopy
hub / github.com/ormar-orm/ormar / run_query

Function run_query

docs_src/queries/docs004.py:29–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27
28@create_drop_database(base_config=ormar_base_config)
29async def run_query():
30 # create multiple instances at once with bulk_create
31 await ToDo.objects.bulk_create(
32 [
33 ToDo(text="Buy the groceries."),
34 ToDo(text="Call Mum.", completed=True),
35 ToDo(text="Send invoices.", completed=True),
36 ]
37 )
38
39 todoes = await ToDo.objects.all()
40 assert len(todoes) == 3
41
42
43asyncio.run(run_query())

Callers 1

docs004.pyFile · 0.70

Calls 3

bulk_createMethod · 0.80
ToDoClass · 0.70
allMethod · 0.45

Tested by

no test coverage detected