Skip to content

feat: add async seeders (AsyncSeeder, AsyncHybridSeeder) - #72

Merged
jedymatt merged 1 commit into
mainfrom
feat/async-seeder
Jul 4, 2026
Merged

feat: add async seeders (AsyncSeeder, AsyncHybridSeeder)#72
jedymatt merged 1 commit into
mainfrom
feat/async-seeder

Conversation

@jedymatt

@jedymatt jedymatt commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Adds async counterparts to the existing seeders for projects running on an AsyncSession.

What

  • AsyncSeeder / AsyncHybridSeeder — same entities and instances API as the sync seeders, but seed() is awaitable.
  • They bridge the existing sync seeding logic through AsyncSession.run_sync, so a filter-key query still executes against the async driver mid-traversal — no async reimplementation of the walk.
  • Top-level exports are guarded in __init__, so sync-only installs without greenlet still import cleanly.
  • New async install extra (pip install "sqlalchemyseed[async]") pulls greenlet; users still bring their own async driver.

Tests

3 new async tests (unittest.IsolatedAsyncioTestCase) against in-memory aiosqlite, covering nested relationships, add_to_session=False, and the filter-key path that exercises real async driver I/O. Full suite: 93 passed.

Docs

  • README "Async usage" section.
  • New docs/async.rst, wired into the toctree.

🤖 Generated with Claude Code

Bridge the existing sync seeders onto AsyncSession via run_sync, so
projects using an async engine can seed without a separate sync engine.
The hybrid seeder's mid-traversal filter queries run through the async
driver inside the greenlet, needing no async reimplementation.

Exports are guarded in __init__ so sync-only installs without greenlet
still import cleanly. Adds an `async` install extra, aiosqlite/greenlet
dev deps, async tests, and README/docs coverage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jedymatt
jedymatt merged commit 0e96b01 into main Jul 4, 2026
16 checks passed
@jedymatt
jedymatt deleted the feat/async-seeder branch July 4, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant