From 429efbdfc5a1ff581dfdb1de5ba19120d350230c Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Thu, 25 Feb 2016 23:48:14 -0500 Subject: [PATCH 1/2] Adds list of tables to check-db --- trapp/command_line.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/trapp/command_line.py b/trapp/command_line.py index 1495fb4..7459aaf 100644 --- a/trapp/command_line.py +++ b/trapp/command_line.py @@ -35,6 +35,16 @@ def checkDB(args): if (args.verbose): print(str(db.cursor)) print('Warnings: ' + str(db.warnings())) + print('') + + # list database tables + if (args.verbose): + print('Tables:') + tables = db.query('SHOW TABLES;', ()) + if tables.with_rows: + records = tables.fetchall() + for table in records: + print(table) def compileGames(): From 62d8f7ce04350c5131f8e632aa3af1526c9a9d43 Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Thu, 25 Feb 2016 23:52:44 -0500 Subject: [PATCH 2/2] Simplifies table checking --- trapp/command_line.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trapp/command_line.py b/trapp/command_line.py index 7459aaf..360535e 100644 --- a/trapp/command_line.py +++ b/trapp/command_line.py @@ -40,11 +40,11 @@ def checkDB(args): # list database tables if (args.verbose): print('Tables:') - tables = db.query('SHOW TABLES;', ()) - if tables.with_rows: - records = tables.fetchall() - for table in records: - print(table) + sql = 'SHOW TABLES' + params = () + records = db.query(sql, params).fetchall() + for table in records: + print(table) def compileGames():