Update DB interface

This commit is contained in:
Bo Maryniuk 2016-06-17 15:46:32 +02:00
parent 0b821b0794
commit dd093739a6

View File

@ -53,11 +53,26 @@ class CsvDB(object):
def new(self):
'''
Create a new database.
Create a new database and opens it.
:return:
'''
def get_tables(self):
'''
Get a list of existin tables in this database.
:return:
'''
def add_table(self, table):
'''
Add table.
:param table:
:return:
'''
def purge(self, dbid):
'''
Purge the database.
@ -68,14 +83,14 @@ class CsvDB(object):
def list(self):
'''
List all the databases.
List all the databases on the given path.
:return:
'''
def open(self):
def open(self, dbname):
'''
Open database.
Open database from the path with the name.
:return:
'''
@ -92,4 +107,34 @@ class CsvDB(object):
Return if the database is closed.
:return:
'''
'''
def table_from_object(self, obj):
'''
Create a table from the object.
:param obj:
:return:
'''
def store(self, obj):
'''
Store an object in the table.
:param obj:
:return:
'''
def get(self, table_name, matches=None, mt=None, lt=None, eq=None):
'''
Get objects from the table.
:param table_name:
:param matches: Regexp.
:param mt: More than.
:param lt: Less than.
:param eq: Equals.
:return:
'''
objects = []
return objects