import sqlite3

with open("app.sql", "r") as f:
    sql_script = f.read()

conn = sqlite3.connect("app.db")
cursor = conn.cursor()
cursor.executescript(sql_script)
conn.commit()
conn.close()

print("Database initialized: app.db")

"""conn = sqlite3.connect("users.db")
c = conn.cursor()
c.execute("CREATE TABLE users (username TEXT, password TEXT)")
c.execute("INSERT INTO users (username, password) VALUES ('anthony.mark@cybercorp.com', 'justinbieber')")
c.execute("INSERT INTO users (username, password) VALUES ('johnson.alice@cybercorp.com', 'tigUE-sTRap-MENTATE')")
c.execute("INSERT INTO users (username, password) VALUES ('smith.bob@cybercorp.com', 'tM82O6KPdD!')")
c.execute("INSERT INTO users (username, password) VALUES ('mallory.eve@cybercorp.com', 'ZBce3O1f*5}7K')")
conn.commit()
conn.close()

conn = sqlite3.connect("products.db")
c = conn.cursor()
c.execute("CREATE TABLE products (name TEXT, description TEXT)")
c.execute("INSERT INTO products (name, description) VALUES ('SuperSecure USB', 'Military grade encryption')")
c.execute("INSERT INTO products (name, description) VALUES ('Hardened Laptop', 'Designed for cybersecurity experts')")
c.execute("INSERT INTO products (name, description) VALUES ('VPN Subscription', 'Private, fast, and anonymous browsing')")
c.execute("INSERT INTO products (name, description) VALUES ('Firewall Pro', 'Enterprise-class perimeter defense')")
c.execute("INSERT INTO products (name, description) VALUES ('Phishing Simulator', 'Test your team with fake phishing campaigns')")
conn.commit()
conn.close()"""

