adewes / blitzdb

Blitz is a document-oriented database for Python that is backend-agnostic. It comes with a flat-file database for JSON documents and provides MongoDB-like querying capabilities.
http://blitzdb.readthedocs.org
MIT License
330 stars 37 forks source link

btree simple #15

Closed jxieeducation closed 10 years ago

jxieeducation commented 10 years ago

Here's a simple BTree implementation that I modified based on Teepark's BTree.

Current flaws with the BTree:

  1. cannot do {key, value} search yet
  2. not sure if the remove method should do nothing if an item is not in list OR raise an exception
  3. no short way of converting a btree from one order to another

However, I think we can build on this to implement the backend index.

adewes commented 10 years ago

Hey @jxieeducation thanks for the pull request, this looks promising! Sorry that I didn't reply faster, I'm really busy right now but will have a detailed look at your code until next week. Thanks for your contribution :)

adewes commented 10 years ago

Hey Jason, sorry for taking so much time to review this, I was really busy this months. So this looks much more promising than the other BTree implementation! I think what we need now is an implementation that supports the following methods implemented in blitzdb.backends.file.index.Index:

Let me know if you have any questions, I think your example goes in the right direction. It will probably a good idea to write tests for the Index class as well so that we have a test suite we can develop against.

adewes commented 10 years ago

Hey @jxieeducation , I will close this PR for now, let me know if you have time to contribute to BlitzDB again, your help is highly appreciated :)