kvesteri / sqlalchemy-continuum

Versioning extension for SQLAlchemy.
BSD 3-Clause "New" or "Revised" License
580 stars 126 forks source link

Example with AsyncSession #276

Open ricardo17coelho opened 2 years ago

ricardo17coelho commented 2 years ago

Hi everyone!

Can someone provide a example how it works with AsyncSession ? Thx 🙏

ryanermita commented 2 years ago

the same challenge here, it seems that it's not working properly using async sqlalchemy.

wonderbeyond commented 1 year ago

Any progress?

AlTosterino commented 1 year ago

Bump!

w20k commented 9 months ago

What helpped me was this. So, it does work with Async, don't have any issues yet or not tested everything 😄 :

make_versioned(user_cls=None)
Base: Type[DeclarativeMeta] = declarative_base()

All the needed tables were created: event_categories event_categories_version transaction

configure_mappers()
await async_connection.run_sync(Base.metadata.drop_all)
await async_connection.run_sync(Base.metadata.create_all)

Hope it will help someone!