(self, sentence: str, values=None, showColumns = False)
| 67 | |
| 68 | |
| 69 | def _select(self, sentence: str, values=None, showColumns = False): |
| 70 | rows = [] |
| 71 | cur = self._get_cursor() |
| 72 | cur.execute(sentence, values) |
| 73 | results = cur.fetchall() |
| 74 | cur.close() |
| 75 | if showColumns: |
| 76 | column_names = [desc[0] for desc in cur.description] |
| 77 | for row in results: |
| 78 | row_with_column_names = {} |
| 79 | for idx, value in enumerate(row): |
| 80 | row_with_column_names[column_names[idx]] = value |
| 81 | rows.append(row_with_column_names) |
| 82 | else: |
| 83 | for row in results: |
| 84 | rows.append(row) |
| 85 | |
| 86 | if len(rows)>0: |
| 87 | return rows |
| 88 | |
| 89 | return None |
| 90 | |
| 91 | def _check_exists_db(self, name:str) -> bool: |
| 92 | sentence = """ |
no test coverage detected