Skip to content

I want to know how gino configures mysql #763

Closed

Description

@zhenzi0322

https://python-gino.org/docs/zh/1.0/tutorials/fastapi.html# I am experiencing unsuccessful mysql configuration when configuring fastapi.

The questions are as follows

?[31mERROR?[0m: Traceback (most recent call last):
File "f:\python\python375\envs\gino-fastapi\lib\site-packages\starlette\routing.py", line 526, in lifespan
async for item in self.lifespan_context(app):
File "f:\python\python375\envs\gino-fastapi\lib\site-packages\starlette\routing.py", line 467, in default_lifespan
await self.startup()
File "f:\python\python375\envs\gino-fastapi\lib\site-packages\starlette\routing.py", line 502, in startup
await handler()
File "f:\python\python375\envs\gino-fastapi\lib\site-packages\gino_starlette.py", line 183, in startup
**config["kwargs"],
File "f:\python\python375\envs\gino-fastapi\lib\site-packages\gino_starlette.py", line 226, in set_bind
return await super().set_bind(bind, loop=loop, **kwargs)
File "f:\python\python375\envs\gino-fastapi\lib\site-packages\gino\api.py", line 417, in set_bind
bind = await create_engine(bind, loop=loop, **kwargs)
File "f:\python\python375\envs\gino-fastapi\lib\site-packages\gino\strategies.py", line 55, in create
pool = await dialect.init_pool(u, loop, pool_class=pool_class)
AttributeError: 'MySQLDialect_mysqldb' object has no attribute 'init_pool'

Activity

  1. changed the title [-]I want to know how mysql is configured into gino[/-] [+]I want to know how gino configures mysql[/+] on Mar 11, 2021
  2. wwwjfy commented on Mar 11, 2021

    @wwwjfy
    Member

    It seems MySQLDialect_mysqldb is the SQLAlchemy implementation.
    This is the synchronous implementation, and gino was created to use async event loop.
    Try to use gino to initialize.

  3. locked and limited conversation to collaborators on Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions