MCPcopy Create free account
hub / github.com/NanmiCoder/MediaCrawler / get_orm_schema

Function get_orm_schema

test/test_db_sync.py:56–64  ·  view source on GitHub ↗

Get table structure of ORM model

()

Source from the content-addressed store, hash-verified

54 return schema
55
56def get_orm_schema():
57 """Get table structure of ORM model"""
58 schema = {}
59 for table_name, table in Base.metadata.tables.items():
60 columns = {}
61 for column in table.columns:
62 columns[column.name] = str(column.type)
63 schema[table_name] = columns
64 return schema
65
66def compare_schemas(db_schema, orm_schema):
67 """Compare database structure with ORM model structure and return differences"""

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected