INNER CODE UNIT · Python
init_sql
bitpoke/mysql-operator · hack/development/stress_test.py:36
def init_sql(self):
pass
def test(self, epoch):
pass
class InsertStress(Base):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.table_name = 'test'
def init_sql(self):
cursor = self.db.cursor()
cursor.execute('CREATE TABLE IF NOT EXISTS {} '
'(f1 VARCHAR(30), f2 VARCHAR(30), f3 VARCHAR(30))'.format(self.table_name))
self.db.commit()