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

Function get_schema_sql

tortoise/utils.py:24–32  ·  view source on GitHub ↗

Generates the SQL schema for the given client. :param client: The DB client to generate Schema SQL for :param safe: When set to true, creates the table only when it does not already exist.

(client: BaseDBAsyncClient, safe: bool)

Source from the content-addressed store, hash-verified

22
23
24def get_schema_sql(client: BaseDBAsyncClient, safe: bool) -> str:
25 """
26 Generates the SQL schema for the given client.
27
28 :param client: The DB client to generate Schema SQL for
29 :param safe: When set to true, creates the table only when it does not already exist.
30 """
31 generator = client.schema_generator(client)
32 return generator.get_create_schema_sql(safe)
33
34
35async def generate_schema_for_client(client: BaseDBAsyncClient, safe: bool) -> None:

Callers 15

_init_forFunction · 0.90
_init_for_sqliteFunction · 0.90
test_schemaFunction · 0.90
test_schema_safeFunction · 0.90
test_m2m_no_auto_createFunction · 0.90
_init_for_mysqlFunction · 0.90
test_mysql_schemaFunction · 0.90
test_mysql_schema_safeFunction · 0.90
test_mysql_index_safeFunction · 0.90
test_mysql_index_unsafeFunction · 0.90

Calls 1

get_create_schema_sqlMethod · 0.80

Tested by 15

_init_forFunction · 0.72
_init_for_sqliteFunction · 0.72
test_schemaFunction · 0.72
test_schema_safeFunction · 0.72
test_m2m_no_auto_createFunction · 0.72
_init_for_mysqlFunction · 0.72
test_mysql_schemaFunction · 0.72
test_mysql_schema_safeFunction · 0.72
test_mysql_index_safeFunction · 0.72
test_mysql_index_unsafeFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…