(self, option:QueryType, value, hash_type:str=None)
| 219 | return information |
| 220 | |
| 221 | def run(self, option:QueryType, value, hash_type:str=None) -> Result: |
| 222 | try: |
| 223 | results = None |
| 224 | self._create_dbCursor() |
| 225 | if self._cursor is not None: |
| 226 | if hash_type is not None: |
| 227 | hashes = [] |
| 228 | for text in value.split(','): |
| 229 | hashes.append(self._get_hashes(hash_type, text)) |
| 230 | value=','.join(hashes) |
| 231 | |
| 232 | if option == QueryType.TABLES: |
| 233 | results = self._filter_tables(value) #self._cursor.search_tables(value) |
| 234 | elif option == QueryType.COLUMNS: |
| 235 | results = self._filter_columns(value) |
| 236 | elif option == QueryType.VALUES: |
| 237 | results = self._filter_by_value(value) |
| 238 | |
| 239 | if results is not None and option != QueryType.VALUES: |
| 240 | criterial = "Tables" if option == QueryType.TABLES else "Columns" |
| 241 | |
| 242 | if self._save_results(criterial, option, results): |
| 243 | AnsiPrint.printResult(results) |
| 244 | AnsiPrint.print(locale.get("summary")) |
| 245 | AnsiPrint.print(locale.get("summary_total").format(length=results.length)) |
| 246 | else: |
| 247 | AnsiPrint.print(locale.get("notfound").format(word=value)) |
| 248 | |
| 249 | |
| 250 | except Exception as e: |
| 251 | AnsiPrint.print_error(e) |
| 252 | |
| 253 | return results |
| 254 | |
| 255 | def select(self, tables:list[str]) -> None: |
| 256 | self._create_dbCursor() |
no test coverage detected