~amirouche/asyncio-foundationdb

16e6bcd3aa3a302f2864de6b1132f0575e58e709 — Amirouche 4 months ago e24a647 dev
README++
1 files changed, 13 insertions(+), 27 deletions(-)

M README.md
M README.md => README.md +13 -27
@@ 1,24 1,11 @@
# [asyncio-foundationdb](https://github.com/amirouche/asyncio-foundationdb/)
# asyncio-foundationdb

*early draft*
**early draft**

asyncio drivers for foundationdb tested with CPython 3.9 and PyPy 3.7

[![Library Database](https://images.unsplash.com/photo-1544383835-bda2bc66a55d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1021&q=80)](https://unsplash.com/photos/lRoX0shwjUQ)

## Table of Content

<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->
- [Getting started](#getting-started)
- [ChangeLog](#changelog)
    - [v0.10.x](#v010x)
- [`import found`](#import-found)
- [`from found import bstore`](#from-found-import-bstore)
- [`from found import nstore`](#from-found-import-nstore)
- [`from found import eavstore`](#from-found-import-eavstore)
- [`from found import pstore`](#from-found-import-pstore)
<!-- markdown-toc end -->

## Getting started

```


@@ 29,19 16,17 @@ pip install asyncio-foundationdb
import found


async def get(tx, key):
    out = await found.get(tx, key)

async def set(tx, key, value):
    return found.set(tx, key, value)


db = await found.open()
out = await found.transactional(db, get, b'hello')
out = await found.transactional(db, found.get, b'hello')
assert out is None

async def set(tx, key, value):
    # found.set is not a coroutine!
    found.set(tx, key, value)

await found.transactional(db, set, b'hello', b'world')
out = await found.transactional(db, get, b'hello')

out = await found.transactional(db, found.get, b'hello')
assert out == b'world'
```



@@ 96,7 81,8 @@ with `key`, returns the object `None`.

### `found.set(tx, key, value)`

Set `key` to `value`.
Set `key` to `value`. `found.set` is not a coroutine, it does not need
`await`.

In the database associated with `tx`, associate `key` with
`value`. Both `key` and `value` must be `bytes`.


@@ 129,8 115,8 @@ range of keys.

If `other=None`, then clear the association that might exists with
`key`. Otherwise, if `other` is provided, `found.clear` will remove
any association between `key` and `other` but not the association with
`other` if any (that is `other` is excluded from the range).
all associations between `key` and `other` but not the association
with `other` if any, that is `other` is excluded from the range.

### async `found.query(tx, key, other, *, limit=0, mode=STREAMING_MODE_ITERATOR)`