diff --git a/bigchaindb/backend/__init__.py b/bigchaindb/backend/__init__.py index 70307ade..89e49559 100644 --- a/bigchaindb/backend/__init__.py +++ b/bigchaindb/backend/__init__.py @@ -1,2 +1,4 @@ +"""Backend interfaces ...""" + # Include the backend interfaces from bigchaindb.backend import changefeed, schema, query # noqa diff --git a/bigchaindb/backend/rethinkdb/__init__.py b/bigchaindb/backend/rethinkdb/__init__.py index e32debe2..42b79735 100644 --- a/bigchaindb/backend/rethinkdb/__init__.py +++ b/bigchaindb/backend/rethinkdb/__init__.py @@ -1,2 +1,4 @@ -# Register the single dispatched modules on import +"""RethinkDB backend components ...""" + +# Register the single dispatched modules on import. from bigchaindb.backend.rethinkdb import changefeed, schema, query # noqa diff --git a/bigchaindb/backend/rethinkdb/connection.py b/bigchaindb/backend/rethinkdb/connection.py index 160669c8..578bbab4 100644 --- a/bigchaindb/backend/rethinkdb/connection.py +++ b/bigchaindb/backend/rethinkdb/connection.py @@ -35,6 +35,10 @@ class RethinkDBConnection(Connection): Args: query: the RethinkDB query. + + Raises: + :exc:`rethinkdb.ReqlDriverError`: After + :attr:`~.RethinkDBConnection.max_tries`. """ if self.conn is None: @@ -49,6 +53,15 @@ class RethinkDBConnection(Connection): self.connect() def connect(self): + """Sets a connection to RethinkDB. + + The connection is available via :attr:`~.RethinkDBConnection.conn`. + + Raises: + :exc:`rethinkdb.ReqlDriverError`: After + :attr:`~.RethinkDBConnection.max_tries`. + + """ for i in range(self.max_tries): try: self.conn = r.connect(host=self.host, port=self.port, diff --git a/docs/server/source/appendices/backend.rst b/docs/server/source/appendices/backend.rst new file mode 100644 index 00000000..2cb035e8 --- /dev/null +++ b/docs/server/source/appendices/backend.rst @@ -0,0 +1,61 @@ +############################################### +:mod:`bigchaindb.backend` -- Backend Interfaces +############################################### + +.. automodule:: bigchaindb.backend + :special-members: __init__ + + +Generic Backend +=============== + +:mod:`bigchaindb.backend.connection` -- Connection +-------------------------------------------------- + +.. automodule:: bigchaindb.backend.connection + +:mod:`bigchaindb.backend.schema` -- Schema +------------------------------------------ +.. automodule:: bigchaindb.backend.schema + +:mod:`bigchaindb.backend.query` -- Query +---------------------------------------- +.. automodule:: bigchaindb.backend.query + +:mod:`bigchaindb.backend.changefeed` -- Changefeed +-------------------------------------------------- +.. automodule:: bigchaindb.backend.changefeed + +:mod:`bigchaindb.backend.utils` +------------------------------- +.. automodule:: bigchaindb.backend.utils + + +:mod:`bigchaindb.backend.rethinkdb` -- RethinkDB Backend +======================================================== + +.. automodule:: bigchaindb.backend.rethinkdb + :special-members: __init__ + +:mod:`bigchaindb.backend.rethinkdb.connection` +---------------------------------------------- + +.. automodule:: bigchaindb.backend.rethinkdb.connection + :special-members: __init__ + +:mod:`bigchaindb.backend.rethinkdb.schema` +------------------------------------------ +.. automodule:: bigchaindb.backend.rethinkdb.schema + +:mod:`bigchaindb.backend.rethinkdb.query` +----------------------------------------- +.. automodule:: bigchaindb.backend.rethinkdb.query + +:mod:`bigchaindb.backend.rethinkdb.changefeed` +---------------------------------------------- +.. automodule:: bigchaindb.backend.rethinkdb.changefeed + + +MongoDB Backend +=============== +Stay tuned! diff --git a/docs/server/source/appendices/index.rst b/docs/server/source/appendices/index.rst index c251db09..41b742b9 100755 --- a/docs/server/source/appendices/index.rst +++ b/docs/server/source/appendices/index.rst @@ -15,6 +15,7 @@ Appendices the-Bigchain-class consensus pipelines + backend aws-setup firewall-notes ntp-notes