(self, sql)
| 111 | return [table[0] for table in cursor] |
| 112 | |
| 113 | def run_query(self, sql): |
| 114 | cursor = self.conn.cursor() |
| 115 | cursor.execute(sql) |
| 116 | column_names = [col[0] for col in cursor.description] |
| 117 | rows = [column_names] # First row is column names |
| 118 | |
| 119 | for row in cursor.fetchall(): |
| 120 | rows.append([str(col) if col is not None else None for col in row]) |
| 121 | |
| 122 | return rows |
| 123 | |
| 124 | def generate_select_all_data_sql(self, database, table_name): |
| 125 | return f"SELECT * FROM {database}.{table_name}" |
no test coverage detected