u1db-discuss team mailing list archive
-
u1db-discuss team
-
Mailing list archive
-
Message #00075
u1db 0.0.2 (second tech preview) released
Hello everyone,
We've just released u1db 0.0.2, which is the second (and likely
penultimate,) tech preview release. You can find it on launchpad[1] and
pypi[2].
It includes changes to the database format as well as the wire protocol,
and is not backwards compatible with the previous tech preview release.
Also due to these changes, our u1db servers have been cleaned of all
user data, as mentioned previously.
It is not expected that we will have to do either of these again (i.e.
change the data/wire format in backwards incompatible ways, or wipe the
servers,) but we reserve the right to do so, and remember: this is still
a preview release, so it is not advisable to use this for important data
just yet.
What has changed since last time is too much to list here, but the
up-to-date documentation[3] is now hosted here:
http://packages.python.org/u1db/
Some of the most notable API changes are:
1. The Document class in Python now has a .get_json() method, which will
return the json string representing the content of the document. The
.content method which previously did this, now returns a python
dictionary representation instead.
2. Creating and querying indexes has become somewhat less cumbersome. To
create an index on a single field:
db.create_index("by-firstname", "first_name")
and to query it:
get_from_index("by-firstname", "John")
And for multiple fields:
db.create_index('test-idx', 'key', 'key2')
db.get_from_index('test-idx', 'value', 'value2'))
[1]: https://launchpad.net/u1db/trunk/0.0.2
[2]: http://pypi.python.org/pypi/u1db/0.0.2
[3]: All the code examples are run by the test suite, and I've gone
through all of the text to check for out of date information, but if you
find any other inaccuracies, typos, or lies, please let me know.
--
eric casteleijn
https://launchpad.net/~thisfred
Follow ups