I'm trying to replace Databases with SQLAlchemy 1.4 async. When I try to make the engine I get the following error:
sqlalchemy.exc.InvalidRequestError: The asyncio extension requires an async driver to be used. The loaded 'mysqldb' is not async.
I'm making the engine like this:
engine = create_async_engine(SQLALCHEMY_DATABASE_URL, future=True)
What is need to get mysqldb to work with SQLAlchemy async?
I figured it out, I was using this URL:
'mysql://someuser:passwd1234@localhost/app_db'
But I needed to be using something like:
'mysql+asyncmy://someuser:asswd1234@localhost/app_db'
I was missing the +asyncmy part to use the asyncmy dialect. I needed to install the package too:
pip install sqlalchemy[asyncio]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With