asyncio drivers for foundationdb tested with CPython 3.5+
In : import found In : import asyncio In : found.api_version(600) In : loop = asyncio.get_event_loop() In : db = loop.run_until_complete(found.open()) In : tr = db._create_transaction() In : loop.run_until_complete(tr.get(b'hello')) In : tr.set(b'hello', b'world') In : loop.run_until_complete(tr.get(b'hello')) Out: b'world'
@transactional is also supported.
pip install asyncio-foundationdb
You must read the official python api documentation, it is awesome.
In general, the asyncio bindings are the same except there is
await that must be added here and there.
Here are differences with the synchronous bindings:
- no shorthand syntax like:
- You can do
value is Noneinstead of
value == None
Transaction.get_rangereturns a list of
If something is missing it's a bug, please fill an issue.