jonra1993 / fastapi-alembic-sqlmodel-async

This is a project template which uses FastAPI, Pydantic 2.0, Alembic and async SQLModel as ORM. It shows a complete async CRUD using authentication and role base access control.
MIT License
878 stars 142 forks source link

I want to use mysql(mariadb) #49

Closed jakekwak closed 1 year ago

jakekwak commented 1 year ago

I want to use MySQLDsn and 'mysql+asyncmy',

but I got the error message

 from pydantic import BaseSettings, PostgresDsn, MySQLDsn, validator, EmailStr, AnyHttpUrl
ImportError: cannot import name 'MySQLDsn' from 'pydantic' (/usr/local/lib/python3.10/site-packages/pydantic/__init__.cpython-310-x86_64-linux-gnu.so)

Is it possible to import MySQLDsn or MariadDBDsn.

jonra1993 commented 1 year ago

Hello @jakekwak I have not used another DB different than Postgresql for this project I am going to check what is wrong MySQLDsn

jakekwak commented 1 year ago

@jonra1993 Thanks, I checked Pydantic library. The latest release v1.10.5 is not include the MySQLDsn and MariaDBDsn. After the new release, I will check again. Thanks so much.