From 187723b567a9787f36ec251e00d73536b1825c0d Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 23 Jul 2019 19:31:43 +0400 Subject: =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20?= =?UTF-8?q?=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D1=8C=20=D0=BB=D0=BE=D0=B3=D0=B3?= =?UTF-8?q?=D0=B5=D1=80=D0=B0.=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=B2=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=B0=D1=85=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=BF=D0=BE=D0=BB=D0=B5=D0=B9=20?= =?UTF-8?q?=D0=B1=D0=B0=D0=B7=D1=8B=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85?= =?UTF-8?q?.=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20?= =?UTF-8?q?=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B4=D0=BB=D1=8F=20=D0=B8?= =?UTF-8?q?=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20Docker.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- day9/task5_vue/backend/database/wrappers.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'day9/task5_vue/backend/database/wrappers.py') diff --git a/day9/task5_vue/backend/database/wrappers.py b/day9/task5_vue/backend/database/wrappers.py index 30d34d9..5bb9761 100644 --- a/day9/task5_vue/backend/database/wrappers.py +++ b/day9/task5_vue/backend/database/wrappers.py @@ -7,6 +7,10 @@ class Wrapper(ABC): def __init__(self): self.schemes = {} + @abstractmethod + def close_connection(self): + pass + @abstractmethod def clear_table(self, table_name): pass @@ -46,6 +50,9 @@ class MySQLWrapper(Wrapper): db=db_name ) + def close_connection(self): + self.connection.close() + def clear_table(self, table_name): cursor = self.connection.cursor() cursor.execute(f"START TRANSACTION; DELETE FROM `{table_name}`; COMMIT;") -- cgit v1.2.3