Exemple #1
0
def table_delete():
    del_table = MySQLWrapper(host, 'tra', 'root', '')
    del_table.delete_table('userlab')
    return del_table


# table_delete()
Exemple #2
0
 def setUp(self):
     host = os.getenv('SERVER_HOST')
     connection_test = MySQLWrapper(host, 'tra', 'root', '')
     self.cursor = connection_test.cursor()
     Table = namedtuple('Table', 'table_name datatype')
     self.bob = Table(table_name='name', datatype='varchar')
     self.jane = Table(table_name='age', datatype='Integer')
Exemple #3
0
def table_update():
    table_updates = MySQLWrapper(host, 'tra', 'root', '')
    table_updates.update('fir1', 'age', '48', 'age', '45')
    return table_updates
Exemple #4
0
def fetch_limit():
    fecth_limit = MySQLWrapper(host, 'tra', 'root', '')
    a = fecth_limit.fetch_limit('fir1', 1)
    return a
Exemple #5
0
def fetch_all():
    fecth_all_records = MySQLWrapper(host, 'tra', 'root', '')
    a = fecth_all_records.fetch_all('fir1')
    return a
Exemple #6
0
def value_insert():
    inserted_values = MySQLWrapper(host, 'tra', 'root', '')
    inserted_values.insert_values('fir1', ['age', 'name'], ['90', '67'])
    return inserted_values
Exemple #7
0
def tab_create():
    table_creation = MySQLWrapper(host, 'tra', 'root', '')
    table_creation.create_table('fir1', [bob, jane])
    return table_creation