From 570f15001e874a4d3454279531843d5a6384130d Mon Sep 17 00:00:00 2001 From: StNicolay Date: Fri, 4 Nov 2022 02:15:16 +0300 Subject: [PATCH] switched mariadb connector to pymysql --- Dockerfile | 3 --- requirements.txt | 2 +- src/database/prepare.py | 4 +--- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4237dab..4df2c88 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,9 +13,6 @@ RUN adduser -u 1000 --disabled-password --gecos "" appuser && chown -R appuser / # Install deps RUN apt update && apt full-upgrade -y -RUN apt install curl gcc g++ -y -RUN curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash -RUN apt install libmariadb3 libmariadb-dev -y # Install pip requirements COPY requirements.txt . diff --git a/requirements.txt b/requirements.txt index b6a95cf..a2a6e09 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ bcrypt cryptography -mariadb +pymysql python-dotenv pyTelegramBotAPI sqlmodel diff --git a/src/database/prepare.py b/src/database/prepare.py index 06f2272..ad487f8 100644 --- a/src/database/prepare.py +++ b/src/database/prepare.py @@ -5,9 +5,7 @@ from . import models def get_engine(host: str, user: str, passwd: str, db: str) -> Engine: - engine = sqlmodel.create_engine( - f"mariadb+mariadbconnector://{user}:{passwd}@{host}/{db}" - ) + engine = sqlmodel.create_engine(f"mariadb+pymysql://{user}:{passwd}@{host}/{db}") return engine