asyncio drivers for FoundationDB
asyncio drivers for foundationdb tested with CPython 3.5+
In : import found In : import asyncio In : found.api_version(510) 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'
Also @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 async and await that must be added here and there.
Here are differences with the synchronous bindings:
- no shorthand syntax like: foo[b'bar']
- You can do value is None instead of value == None
- Transaction.get_range returns a list of (key, value) pairs
If something is missing it’s a bug, please fill an issue.