pharmacy dashboard
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import sqlite3
|
||||
|
||||
conn = sqlite3.connect('users.db')
|
||||
cursor = conn.cursor()
|
||||
|
||||
cursor.execute("SELECT name FROM sqlite_master WHERE type='table'")
|
||||
tables = [r[0] for r in cursor.fetchall()]
|
||||
print("Tables in users.db:", tables)
|
||||
|
||||
for t in tables:
|
||||
cursor.execute(f"PRAGMA table_info({t})")
|
||||
cols = [r[1] for r in cursor.fetchall()]
|
||||
print(f"\nTable: {t}")
|
||||
print(f"Columns: {cols}")
|
||||
cursor.execute(f"SELECT COUNT(*) FROM {t}")
|
||||
cnt = cursor.fetchone()[0]
|
||||
print(f"Row count: {cnt}")
|
||||
|
||||
conn.close()
|
||||
Reference in New Issue
Block a user