def test_create_table(): database = MySQLServer() database.set_mysql('../config/mysql_account.json') database.start() database.use_db('create_db') database.create_table('../config/table_MovieList.json') database.stop()
def test_insert(): database = MySQLServer() database.set_mysql('../config/mysql_account.json') database.start() database.use_db('create_db') database.insert('MovieList', { 'id': '123' }) database.stop()
def test_count(): # start database = MySQLServer('../config/mysql_account.json') database.start() database.use_db('douban_movies') # select num = database.count(table_name='my_proxy') print(num) # stop database.stop()
def test_select(): # start database = MySQLServer('../config/mysql_account.json') database.start() database.use_db('douban_movies') # select database.select(table_name='my_proxy') print(database.fetchone()) database.select(table_name='my_proxy', where={}, limit=2) print(database.fetchall()) # stop database.stop()