You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
976 B
Python
31 lines
976 B
Python
|
|
import asyncio
|
|
import os
|
|
import sys
|
|
|
|
# Ensure the project root is on the path
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
from sqlalchemy import select
|
|
from src.database.core import async_session
|
|
from src.fmea.model import FMEARecord
|
|
|
|
async def check_valve_data():
|
|
async with async_session() as session:
|
|
result = await session.execute(
|
|
select(FMEARecord).filter(FMEARecord.equipment.like("%Valve%")).limit(5)
|
|
)
|
|
records = result.scalars().all()
|
|
for r in records:
|
|
print(f"ID: {r.id}")
|
|
print(f"System: {r.system}")
|
|
print(f"Equipment: {r.equipment}")
|
|
print(f"Function: {r.function}")
|
|
print(f"Standard Perf: {r.standard_performance}")
|
|
print(f"Failure Mode: {r.failure_mode}")
|
|
print(f"Actions Taken: {r.actions_taken}")
|
|
print("-" * 20)
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(check_valve_data())
|