pharmacy-pos-qr-system/check_images_db.py
thug0bin fa4e87b461 feat: 판매내역 페이지에 제품 썸네일 이미지 표시
- app.py: /api/sales-detail에서 product_images.db 조회하여 thumbnail 반환
- admin_sales_pos.html: 거래별/목록 뷰에 36x36 썸네일 표시
- 이미지 없는 제품은 📦 플레이스홀더 표시
- barcode 우선, drug_code 폴백으로 이미지 매칭
2026-03-04 12:19:06 +09:00

27 lines
833 B
Python

import sqlite3
conn = sqlite3.connect(r'C:\Users\청춘약국\source\pharmacy-pos-qr-system\backend\db\product_images.db')
cursor = conn.cursor()
# 테이블 목록
cursor.execute('SELECT name FROM sqlite_master WHERE type="table"')
tables = [r[0] for r in cursor.fetchall()]
print("테이블:", tables)
# 각 테이블 스키마
for table in tables:
cursor.execute(f'PRAGMA table_info({table})')
cols = [r[1] for r in cursor.fetchall()]
print(f"\n{table} 컬럼: {cols}")
# 샘플 데이터
cursor.execute(f'SELECT * FROM {table} LIMIT 2')
rows = cursor.fetchall()
for r in rows:
print(f" 샘플: {r[:3]}..." if len(r) > 3 else f" 샘플: {r}")
# 총 개수
for table in tables:
cursor.execute(f'SELECT COUNT(*) FROM {table}')
print(f"\n{table}{cursor.fetchone()[0]}")