import sqlite3
class DataBase:
    def __init__(self,name):
        self.name=name
        self.con = sqlite3.connect(self.name)
        self.cur = self.con.cursor()
    def setup(self):
        self.cur.execute("""CREATE TABLE IF NOT EXISTS URLS (
        company NOT NULL,
        url NOT NULL UNIQUE,
        sitemap,
        robots,
        title,
        meta_description,
        keywords
        );
        """)
    def select_all_data(self):
        res = self.cur.execute("SELECT * FROM URLS;")
        return res.fetchall()
    def insert_data(self,data):
        try:
            self.cur.executemany("INSERT INTO URLS VALUES(?, ?, ?, ?, ?, ?, ?)", data)
            self.con.commit()
            return "Inserted Successfully"
        except BaseException as e:
            return str(e)
    def update_data(self):
        pass
    def delete_data(self):
        try:
            self.cur.execute(f"DELETE FROM URLS WHERE url>
            self.con.commit()
            return "Deleted Successfully"
        except BaseException as e:
            return str(e)
if __name__=="__main__":
    db= DataBase("search_data.db")

