summaryrefslogtreecommitdiff
path: root/jfr_playoff/db.py
diff options
context:
space:
mode:
Diffstat (limited to 'jfr_playoff/db.py')
-rw-r--r--jfr_playoff/db.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/jfr_playoff/db.py b/jfr_playoff/db.py
index b94f3d5..ad32ac8 100644
--- a/jfr_playoff/db.py
+++ b/jfr_playoff/db.py
@@ -16,7 +16,15 @@ class PlayoffDB(object):
def get_cursor(self):
return self.db_cursor
- def fetch(self, db_name, sql, params):
+ def __execute_query(self, db_name, sql, params):
self.db_cursor.execute(sql.replace('#db#', db_name), params)
+
+ def fetch(self, db_name, sql, params):
+ self.__execute_query(db_name, sql, params)
row = self.db_cursor.fetchone()
return row
+
+ def fetch_all(self, db_name, sql, params):
+ self.__execute_query(db_name, sql, params)
+ results = self.db_cursor.fetchall()
+ return results