sqlalchemyseed.aio

Async wrappers around the synchronous seeders.

These bridge the existing sync-only seeder logic onto an AsyncSession using run_sync(), which runs the sync code inside a greenlet where the driver’s blocking I/O is translated into await calls. No parallel async reimplementation of the traversal is needed.

Module Contents

class sqlalchemyseed.aio.AsyncHybridSeeder(session: sqlalchemy.ext.asyncio.AsyncSession, ref_prefix: str = '!', strict: bool = False)

Async counterpart of HybridSeeder.

The hybrid seeder issues queries (filter keys) during the seed traversal, so it genuinely needs a live connection; run_sync supplies a real sync Session whose queries are proxied to the async driver.

strict is forwarded as-is to the wrapped sync HybridSeeder.

async seed(entities: list | dict)
property instances: tuple
ref_prefix = '!'
session
strict = False
class sqlalchemyseed.aio.AsyncSeeder(session: sqlalchemy.ext.asyncio.AsyncSession, ref_prefix: str = '!', strict: bool = False)

Async counterpart of Seeder.

strict is forwarded as-is to the wrapped sync Seeder.

async seed(entities: list | dict, add_to_session: bool = True)
property instances: tuple
ref_prefix = '!'
session
strict = False