pass-gen/app/data/sqlite.py
2021-08-02 19:45:29 +02:00

14 lines
406 B
Python

import sqlite3
class DB:
def __init__(self, db_str="pg.db") -> None:
self.connection = sqlite3.connect(db_str)
self.cursor = self.connection.cursor()
self.execute("CREATE TABLE IF NOT EXISTS passwords (password text)")
def commit(self) -> None:
self.connection.commit()
def execute(self, query: str, *args) -> None:
self.cursor.execute(query, *args)