MCPcopy
hub / github.com/tortoise/tortoise-orm / run

Function run

examples/schema_create.py:50–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48
49
50async def run():
51 print("SQLite:\n")
52 await Tortoise.init(db_url="sqlite://:memory:", modules={"models": ["__main__"]})
53 sql = get_schema_sql(connections.get("default"), safe=False)
54 print(sql)
55
56 print("\n\nMySQL:\n")
57 await Tortoise.init(db_url="mysql://root:@127.0.0.1:3306/", modules={"models": ["__main__"]})
58 sql = get_schema_sql(connections.get("default"), safe=False)
59 print(sql)
60
61 print("\n\nPostgreSQL:\n")
62 await Tortoise.init(
63 db_url="postgres://postgres:@127.0.0.1:5432/", modules={"models": ["__main__"]}
64 )
65 sql = get_schema_sql(connections.get("default"), safe=False)
66 print(sql)
67
68
69if __name__ == "__main__":

Callers 1

schema_create.pyFile · 0.70

Calls 3

get_schema_sqlFunction · 0.90
initMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected