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

13 lines
348 B
Python

from typing import Any
class PasswordRepository:
def __init__(self, db: Any) -> None:
self.db = db
def save(self, password: str) -> None:
try:
self.db.execute(f"INSERT INTO passwords VALUES (:password)", {"password": password})
self.db.commit()
except Exception as e:
print(e)