From 7cfb97199f3afd9e7dd9cb70e20a2aff9bcf58f1 Mon Sep 17 00:00:00 2001 From: StNicolay <103897650+StNicolay@users.noreply.github.com> Date: Wed, 5 Oct 2022 14:44:03 +0300 Subject: [PATCH] Completed add_master pass function --- src/database/add.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/database/add.py b/src/database/add.py index d9ab7f7..208e379 100644 --- a/src/database/add.py +++ b/src/database/add.py @@ -1,8 +1,15 @@ import mariadb -def add_master_pass(hashed_passwd: bytes, salt: bytes, con: mariadb.Connection) -> bool: - ... +def add_master_pass( + id: int, hashed_passwd: bytes, salt: bytes, con: mariadb.Connection +) -> bool: + cursor = con.cursor() + cursor.execute( + "INSERT INTO master_pass (user_id, salt, passwd) VALUES (?, ?, ?)", + [id, hashed_passwd, salt], + ) + cursor.close() def add_account(