Filled delete.py and created change.py

This commit is contained in:
StNicolay
2022-10-14 17:48:32 +03:00
parent 85129d8b7a
commit 7fe7b23a63
3 changed files with 36 additions and 2 deletions

16
src/database/change.py Normal file
View File

@ -0,0 +1,16 @@
import sqlmodel
from sqlalchemy.future import Engine
from . import models
def change_master_pass(
engine: Engine, user_id: int, salt: bytes, passwd: bytes
) -> None:
statement = sqlmodel.update(
models.MasterPass,
models.MasterPass.user_id == user_id,
sqlmodel.values(salt=salt, passwd=passwd),
)
with sqlmodel.Session(engine) as session:
session.exec(statement)