Skip to content

Support mptt_sessionmaker with async session #76

Description

@xykylikuf001

Simple steps for reproduce:

from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from sqlalchemy.orm import sessionmaker
from sqlalchemy_mptt import mptt_sessionmaker


async_engine = create_async_engine("postgresql+asyncpg://scott:tiger@localhost/test", pool_pre_ping=True, echo=settings.DEBUG)
AsyncSessionLocal = mptt_sessionmaker(sessionmaker(
    class_=AsyncSession,
    expire_on_commit=False,
    autocommit=False,
    autoflush=False,
    bind=async_engine,
    future=True,
), )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions