a9a15966e2bc3b1399241b06b18bc06769d579fa
This commit adds an optional `callback` argument to the `ChunkedInsert`
object. This callback is a callable object which gets called before the
chunked insert happens. This is useful for clearing any local caches
that may be in place to deal with the eventual consistency resulting
from the delayed nature of the chunked inserts.
For example,
```
cache = set()
chunked_table = ChunkedInsert(table, callback=lambda queue: cache.clear())
while True:
data = get_data_id()
key = data['key']
if key in cache or table.find_one(key=key)
continue
cache.add(key)
chunked_table.insert(data)
```
dataset: databases for lazy people
In short, dataset makes reading and writing data in databases as simple as reading and writing JSON files.
To install dataset, fetch it with pip:
$ pip install dataset
Note: as of version 1.0, dataset is split into two packages, with the data export features now extracted into a stand-alone package, datafreeze. See the relevant repository here.
Description
Upgraded dataset version from https://github.com/pudo/dataset/. This one uses new SQLAlchemy2.
870 KiB
Languages
Python
99.5%
Makefile
0.5%
