Skip to content

Support mptt_sessionmaker with async session #76

Open
@xykylikuf001

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,
), )

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions