Skip to content

v0.1.0

Choose a tag to compare

@mrprfrm mrprfrm released this 11 Apr 16:41
· 9 commits to master since this release
f37fffe

Async Wrapper for TinyDB

Introduces AIOBridge, an async-safe proxy for TinyDB operations. It leverages asyncio.to_thread to offload synchronous calls and uses a per-path asyncio.Lock to ensure safe concurrency. All core database and table-level operations are exposed via async def methods, each returning Result-wrapped responses for safe, exception-free handling.

Examples

Demonstrates customization of the bridge using:

  • A custom TinyDB class with MemoryStorage
  • An extended method (getmany) for multi-record fetches

Usage is shown in a real-world pattern with async with context management and structured return handling.

Test Suite

Includes:

  • Parametrized test coverage across all key bridge methods
  • run_concurrently helper for stress-testing async behavior and verifying concurrency safety
  • Fixtures for injecting pre-populated databases to simulate realistic testing scenarios