summaryrefslogtreecommitdiff
path: root/extmod/modbtree.c
AgeCommit message (Collapse)Author
2017-07-24all: Don't include system errno.h when it's not needed.Damien George
2017-03-29extmod: Update for changes to mp_obj_str_get_data.Damien George
2017-02-16py: Add iter_buf to getiter type method.Damien George
Allows to iterate over the following without allocating on the heap: - tuple - list - string, bytes - bytearray, array - dict (not dict.keys, dict.values, dict.items) - set, frozenset Allows to call the following without heap memory: - all, any, min, max, sum TODO: still need to allocate stack memory in bytecode for iter_buf.
2016-12-05extmod/modbtree: Rename "sync" method to "flush" for consistency.Paul Sokolovsky
Rename recently introduced "sync" method to "flush" for consistency with usual files.
2016-12-02extmod/modbtree: Add method to sync the database.w4kpm
If you have longish operations on the db (such as logging data) it may be desirable to periodically sync the database to the disk. The added btree.sync() method merely exposes the berkley __bt_sync function to the user.
2016-10-07extmod: Use mp_raise_OSError helper function.Damien George
2016-09-22all: Remove 'name' member from mp_obj_module_t struct.Damien George
One can instead lookup __name__ in the modules dict to get the value.
2016-08-24extmod/modbtree: do CHECK_ERROR after __bt_seq()Krzysztof Blazewicz
In `btree_seq()`, when `__bt_seq()` gets called with invalid `flags` argument it will return `RET_ERROR` and it won't initialize `val`. If field `data` of uninitialized `val` is passed to `mp_obj_new_bytes()` it causes a segfault.
2016-08-06extmod/modbtree: open(): Add option kwargs.Paul Sokolovsky
Namely: flags, cachesize, pagesize, minkeypage.
2016-08-02extmod/modbtree: Implement __contains__ operation.Paul Sokolovsky
2016-07-31extmod/modbtree: Switch to accepting stream object instead of filename.Paul Sokolovsky
Requires "embedded" BerkeleyDB BTree implementation.
2016-07-24extmod/modbtree: Check __bt_open() return value for error.Paul Sokolovsky
2016-07-02extmod/modbtree: Fixes for nanbox build.Paul Sokolovsky
2016-07-02extmod/modbtree: Fix unused argument warning.Paul Sokolovsky
2016-06-23extmod/modbtree: Cleverly implement "for key in btree:" syntax.Paul Sokolovsky
I.e. make it work like btree.keys(), while still not using a separate iterator type.
2016-06-20extmod/modbtree: Implement keys(), values(), items() iterators.Paul Sokolovsky
Each takes optional args of starting key, ending key, and flags (ending key inclusive, reverse order).
2016-06-18extmod/modbtree: open(): Support "in-memory" database with filename=None.Paul Sokolovsky
It's not really in-memory though, just uses anonymous temporary file on disk.
2016-06-18extmod/modbtree: __getitem__() should raise KeyError for non-existing key.Paul Sokolovsky
2016-06-18extmod/modbtree: items(): Implement DESC flag.Paul Sokolovsky
2016-06-17extmod/modbtree: items(): Implement "end key inclusive" flag.Paul Sokolovsky
2016-06-16extmod/modbtree: Actually implement end key support for .items().Paul Sokolovsky
2016-06-16extmod/modbtree: Implement .items() iterator.Paul Sokolovsky
2016-06-15extmod/modbtree: Handle default value and error check.Paul Sokolovsky
2016-06-14extmod/modbtree: Initial implementation of "btree" module based on BerkeleyDB.Paul Sokolovsky
This implements basic wrapping of native get/put/seq API, and then dictionary access protocol. Native API is intended to be superceded going forward.