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

Function run_query

docs_src/queries/docs006.py:41–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39
40@create_drop_database(base_config=ormar_base_config)
41async def run_query():
42 # build some sample data
43 toyota = await Company.objects.create(name="Toyota", founded=1937)
44 await Car.objects.create(
45 manufacturer=toyota,
46 name="Corolla",
47 year=2020,
48 gearbox_type="Manual",
49 gears=5,
50 aircon_type="Manual",
51 )
52 await Car.objects.create(
53 manufacturer=toyota,
54 name="Yaris",
55 year=2019,
56 gearbox_type="Manual",
57 gears=5,
58 aircon_type="Manual",
59 )
60 await Car.objects.create(
61 manufacturer=toyota,
62 name="Supreme",
63 year=2020,
64 gearbox_type="Auto",
65 gears=6,
66 aircon_type="Auto",
67 )
68
69
70asyncio.run(run_query())

Callers 1

docs006.pyFile · 0.70

Calls 1

createMethod · 0.45

Tested by

no test coverage detected