From 4343a9297c195d8b59f87e7aaeccc1fd5baad636 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Tue, 6 Dec 2016 10:32:32 +0100 Subject: [PATCH] Add docstrings for database schema interface --- bigchaindb/backend/schema.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/bigchaindb/backend/schema.py b/bigchaindb/backend/schema.py index 5fcba260..18d85d51 100644 --- a/bigchaindb/backend/schema.py +++ b/bigchaindb/backend/schema.py @@ -5,19 +5,51 @@ from functools import singledispatch @singledispatch def create_database(connection, name): + """Create database to be used by BigchainDB + + Args: + name (str): the name of the database to create. + + Raises: + :exc:`~bigchaindb.common.exceptions.DatabaseAlreadyExists`: If the + given :attr:`name` already exists as a database. + """ + raise NotImplementedError @singledispatch def create_tables(connection, name): + """Create the tables to be used by BigchainDB + + Args: + name (str): the name of the database to create tables for. + """ + raise NotImplementedError @singledispatch def create_indexes(connection, name): + """Create the indexes to be used by BigchainDB + + Args: + name (str): the name of the database to create indexes for. + """ + raise NotImplementedError @singledispatch def drop_database(connection, name): + """Drop the database used by BigchainDB + + Args: + name (str): the name of the database to drop. + + Raises: + :exc:`~bigchaindb.common.exceptions.DatabaseDoesNotExist`: If the + given :attr:`name` does not exist as a database. + """ + raise NotImplementedError