chore: initialize project repository
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from sqlalchemy import create_engine, inspect
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
||||
from app.core.config import get_settings
|
||||
|
||||
if __name__ == "__main__":
|
||||
engine = create_engine(get_settings().mysql_dsn.replace("mysql+asyncmy", "mysql+pymysql"))
|
||||
inspector = inspect(engine)
|
||||
for name in sys.argv[1:]:
|
||||
print(name)
|
||||
for column in inspector.get_columns(name):
|
||||
print(column["name"], column["type"],
|
||||
"nullable" if column["nullable"] else "required", column.get("default"))
|
||||
engine.dispose()
|
||||
Reference in New Issue
Block a user