switched mariadb connector to pymysql
This commit is contained in:
parent
b4bf9fbf41
commit
570f15001e
@ -13,9 +13,6 @@ RUN adduser -u 1000 --disabled-password --gecos "" appuser && chown -R appuser /
|
|||||||
|
|
||||||
# Install deps
|
# Install deps
|
||||||
RUN apt update && apt full-upgrade -y
|
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
|
# Install pip requirements
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
bcrypt
|
bcrypt
|
||||||
cryptography
|
cryptography
|
||||||
mariadb
|
pymysql
|
||||||
python-dotenv
|
python-dotenv
|
||||||
pyTelegramBotAPI
|
pyTelegramBotAPI
|
||||||
sqlmodel
|
sqlmodel
|
||||||
|
@ -5,9 +5,7 @@ from . import models
|
|||||||
|
|
||||||
|
|
||||||
def get_engine(host: str, user: str, passwd: str, db: str) -> Engine:
|
def get_engine(host: str, user: str, passwd: str, db: str) -> Engine:
|
||||||
engine = sqlmodel.create_engine(
|
engine = sqlmodel.create_engine(f"mariadb+pymysql://{user}:{passwd}@{host}/{db}")
|
||||||
f"mariadb+mariadbconnector://{user}:{passwd}@{host}/{db}"
|
|
||||||
)
|
|
||||||
return engine
|
return engine
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user