Giter Club home page Giter Club logo

u2db's Introduction

Getting started
===============

The easiest way to get started is to use "setup.py install", preferably
in a virtualenv (although that's up to you).


Using the database interface
============================

Inserting and retrieving documents::

    import u1db
    db = u1db.open(":memory:", create=True)
    doc = db.create_doc({"firstname": "Bob", "familyname": "Foo"})
    print "document id: %s" % doc.doc_id
    print "document revision: %s" % doc.revision

    doc2 = db.get_doc(doc.doc_id)
    print (doc == doc2)

Creating an index::

    import u1db
    db = u1db.open(":memory:", create=True)
    # Indexes can be on a single field...
    idx = db.create_index("firstname_idx", ["firstname"])
    # ... or on several
    idx2 = db_create_index("composed_idx", ["firstname", "familyname"])

Querying using an index::

    import u1db
    db = u1db.open(":memory:", create=True)
    doc = db.get_from_index("firstname_idx", [("Bob",)])
    print doc
    # You can of course get a range of documents using wildcards
    docs = db.get_from_index("firstname_idx", [("Bo*",)])

More information and comments can be found in the u1db/__init__.py file.


Running the tests
=================

A simple `make check` should get you on the right tracks. The dependencies can
be infered from the output.


Building the docs
=================

cmake . && make html-docs

after which the reference implementation documentation can be found at::

html-docs/_build/html/index.html

and the C implementation documentation at::

html-docs/_doxygen/html/index.html

though a more useful starting point may be::

_doxygen/html/u1db_8h.html

u2db's People

Contributors

jameinel avatar pedronis avatar dobey avatar joseexposito avatar dgreisen avatar toabctl avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.