def table_delete(): del_table = MySQLWrapper(host, 'tra', 'root', '') del_table.delete_table('userlab') return del_table # table_delete()
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')
def table_update(): table_updates = MySQLWrapper(host, 'tra', 'root', '') table_updates.update('fir1', 'age', '48', 'age', '45') return table_updates
def fetch_limit(): fecth_limit = MySQLWrapper(host, 'tra', 'root', '') a = fecth_limit.fetch_limit('fir1', 1) return a
def fetch_all(): fecth_all_records = MySQLWrapper(host, 'tra', 'root', '') a = fecth_all_records.fetch_all('fir1') return a
def value_insert(): inserted_values = MySQLWrapper(host, 'tra', 'root', '') inserted_values.insert_values('fir1', ['age', 'name'], ['90', '67']) return inserted_values
def tab_create(): table_creation = MySQLWrapper(host, 'tra', 'root', '') table_creation.create_table('fir1', [bob, jane]) return table_creation