python-gino / gino

GINO Is Not ORM - a Python asyncio ORM on SQLAlchemy core.
https://python-gino.org/
Other
2.67k stars 150 forks source link

TypeError while trying to initialize Gino db with MySQL #810

Open vicctorb2 opened 2 years ago

vicctorb2 commented 2 years ago

TypeError while trying to initialize Gino db with MySQL

To Reproduce

from gino_starlette import Gino
DATABASE_URL = f"mysql+aiomysql://{DATABASE_USER}:{DATABASE_PASSWORD}@{DATABASE_HOST}:{DATABASE_PORT}/{DATABASE_NAME}"

db = Gino(
    dsn=DATABASE_URL,
    echo=True
)

Actual result

Cannot connect to the database; max retries reached.
ERROR:    Traceback (most recent call last):
  File "...projects/.../.venv39/lib/python3.9/site-packages/starlette/routing.py", line 621, in lifespan
    async with self.lifespan_context(app):
  File "...projects/.../.venv39/lib/python3.9/site-packages/starlette/routing.py", line 518, in __aenter__
    await self._router.startup()
  File "...projects/.../.venv39/lib/python3.9/site-packages/starlette/routing.py", line 598, in startup
    await handler()
  File "...projects/.../.venv39/lib/python3.9/site-packages/gino_starlette.py", line 177, in startup
    await self.set_bind(
  File "...projects/.../.venv39/lib/python3.9/site-packages/gino_starlette.py", line 226, in set_bind
    return await super().set_bind(bind, loop=loop, **kwargs)
  File "...projects/.../.venv39/lib/python3.9/site-packages/gino/api.py", line 427, in set_bind
    bind = await create_engine(bind, loop=loop, bakery=self._bakery, **kwargs)
  File "...projects/.../.venv39/lib/python3.9/site-packages/gino/strategies.py", line 68, in create
    raise TypeError(
TypeError: Invalid argument(s) 'min_size','max_size' sent to create_engine(), using configuration AiomysqlDialect/GinoEngine.  Please check that the keyword arguments are appropriate for this combination of components.

Environment: