FA3-Datafetch/backend/debug_settings_pg.py
2026-01-13 14:49:36 +08:00

27 lines
666 B
Python

import asyncio
import sys
import os
# Add backend to path
sys.path.append('/Users/xucheng/git.qubit.ltd/FA3/backend')
from app.database import SessionLocal
from app.models import Setting
from sqlalchemy import select
async def main():
async with SessionLocal() as session:
result = await session.execute(select(Setting))
settings = result.scalars().all()
print("--- Postgres Settings ---")
for s in settings:
print(f"Key: {s.key}, Value: {s.value}")
print("-------------------------")
if __name__ == "__main__":
try:
asyncio.run(main())
except Exception as e:
print(f"Error: {e}")